gitter
gitter copied to clipboard
PrettyFormat trips on invalid UTF-8 sequences
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);
}
please work here: https://github.com/patrikx3/gitter