Skip to content

Commit

Permalink
Replace utf8_encode/decode with mb_convert_encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
smnandre committed Jan 14, 2024
1 parent ce7854f commit 6c361be
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/Nodes/Table/TableColumn.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
use Doctrine\RST\Nodes\Node;
use LogicException;

use function mb_convert_encoding;
use function strlen;
use function trim;
use function utf8_encode;

final class TableColumn
{
Expand All @@ -27,7 +27,7 @@ final class TableColumn

public function __construct(string $content, int $colSpan)
{
$this->content = utf8_encode(trim($content));
$this->content = mb_convert_encoding(trim($content), 'UTF-8', 'ISO-8859-1');
$this->colSpan = $colSpan;
}

Expand Down
4 changes: 2 additions & 2 deletions lib/Nodes/TableNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
use function implode;
use function ksort;
use function max;
use function mb_convert_encoding;
use function preg_match;
use function sprintf;
use function str_repeat;
use function strlen;
use function strpos;
use function substr;
use function trim;
use function utf8_decode;

class TableNode extends Node
{
Expand Down Expand Up @@ -136,7 +136,7 @@ public function pushContentLine(string $line): void
throw new LogicException('Cannot push data after TableNode is compiled');
}

$this->rawDataLines[$this->currentLineNumber] = utf8_decode($line);
$this->rawDataLines[$this->currentLineNumber] = mb_convert_encoding($line, 'ISO-8859-1', 'UTF-8');
$this->currentLineNumber++;
}

Expand Down

0 comments on commit 6c361be

Please sign in to comment.