Skip to content

Commit

Permalink
Use mb_convert_encoding instead of utf8_decode
Browse files Browse the repository at this point in the history
  • Loading branch information
fancyweb committed Apr 21, 2022
1 parent 0fcad58 commit dcb67ea
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Tests/Loader/XliffFileLoaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ public function testEncoding()
$loader = new XliffFileLoader();
$catalogue = $loader->load(__DIR__.'/../fixtures/encoding.xlf', 'en', 'domain1');

$this->assertEquals(utf8_decode('föö'), $catalogue->get('bar', 'domain1'));
$this->assertEquals(utf8_decode('bär'), $catalogue->get('foo', 'domain1'));
$this->assertEquals(mb_convert_encoding('föö', 'ISO-8859-1', 'UTF-8'), $catalogue->get('bar', 'domain1'));
$this->assertEquals(mb_convert_encoding('bär', 'ISO-8859-1', 'UTF-8'), $catalogue->get('foo', 'domain1'));
$this->assertEquals(
[
'source' => 'foo',
'notes' => [['content' => utf8_decode('bäz')]],
'notes' => [['content' => mb_convert_encoding('bäz', 'ISO-8859-1', 'UTF-8')]],
'id' => '1',
'file' => [
'original' => 'file.ext',
Expand Down

0 comments on commit dcb67ea

Please sign in to comment.