From dcb67eae126e74507e0b4f0b9ac6ef35b37c3331 Mon Sep 17 00:00:00 2001 From: Thomas Calvet Date: Thu, 21 Apr 2022 09:22:34 +0200 Subject: [PATCH] Use mb_convert_encoding instead of utf8_decode --- Tests/Loader/XliffFileLoaderTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Tests/Loader/XliffFileLoaderTest.php b/Tests/Loader/XliffFileLoaderTest.php index 16408298..99fcb458 100644 --- a/Tests/Loader/XliffFileLoaderTest.php +++ b/Tests/Loader/XliffFileLoaderTest.php @@ -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',