Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PrettyFormat trips on invalid UTF-8 sequences #23

Open
lionello opened this issue Jul 22, 2013 · 1 comment
Open

PrettyFormat trips on invalid UTF-8 sequences #23

lionello opened this issue Jul 22, 2013 · 1 comment

Comments

@lionello
Copy link

The guichan repo (https://code.google.com/p/guichan/) has some log entries which are utf-8 encoded, some which are not. All of these get appended together and the XML encoder has not way to parse the string.

Fixed by adding a single line to getPrettyFormat in Repository.php:

     public function getPrettyFormat($command)
     {
         $output = $this->getClient()->run($this, $command);
         $format = new PrettyFormat;

+        // Remove invalid UTF-8 sequences (which would trip the XML parser)
+        $output = mb_convert_encoding($output, 'UTF-8', 'UTF-8');
         return $format->parse($output);
     }
@p3x-robot
Copy link

please work here:
https://github.com/patrikx3/gitter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants