Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Commit

Permalink
Revert "Merge branch 'superdweebie-rand-bugfix'"
Browse files Browse the repository at this point in the history
This reverts commit 002ce3dee6107f2c71af8e7ce0ed1f43693ddadf, reversing
changes made to 0023a96e4756112661c11dbf4e293f4be110809a.

Note: we will need to revert this revert when merging develop to master for the
2.3.0 release. See http://git-scm.com/blog/2010/03/02/undoing-merges.html - the
section on "Reverting the Revert," for details.
  • Loading branch information
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 2,163 deletions.
26 changes: 0 additions & 26 deletions src/Adapter/AbstractAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ abstract class AbstractAdapter implements AdapterInterface
*/
public function write($text, $color = null, $bgColor = null)
{
//Encode text to match console encoding
$text = $this->encodeText($text);

if ($color !== null || $bgColor !== null) {
echo $this->colorize($text, $color, $bgColor);
} else {
Expand Down Expand Up @@ -500,27 +497,4 @@ public function readChar($mask = null)
fclose($f);
return $char;
}

/**
* Encode a text to match console encoding
*
* @param string $text
* @return string the encoding text
*/
public function encodeText($text)
{
if ($this->isUtf8()) {
if (StringUtils::isValidUtf8($text)) {
return $text;
}

return utf8_encode($text);
}

if (StringUtils::isValidUtf8($text)) {
return utf8_decode($text);
}

return $text;
}
}
Loading

0 comments on commit ae205d0

Please sign in to comment.