From a4cbd1b7ec59af2d2ebea363fe6bba7766c34fd7 Mon Sep 17 00:00:00 2001 From: Dmitry Khomutov Date: Sun, 3 Sep 2017 11:11:03 +0700 Subject: [PATCH] Fixes for non-unicode binary log output. Issue #116. --- src/PHPCensor/Helper/CommandExecutor.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/PHPCensor/Helper/CommandExecutor.php b/src/PHPCensor/Helper/CommandExecutor.php index 40de3b10..82ef3ad0 100644 --- a/src/PHPCensor/Helper/CommandExecutor.php +++ b/src/PHPCensor/Helper/CommandExecutor.php @@ -102,6 +102,9 @@ class CommandExecutor implements CommandExecutorInterface $status = proc_close($process); } + mb_substitute_character(ord('?')); + + $this->lastOutput = mb_convert_encoding($this->lastOutput, 'utf8', 'utf8'); $this->lastOutput = array_filter(explode(PHP_EOL, $this->lastOutput)); $shouldOutput = ($this->logExecOutput && ($this->verbose || $status != 0));