X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=tests%2F0CharsetTest.php;h=549b0f421045518084f24f9d85f0dbb6757ed534;hb=5d63c263e763338952815b6724ffa4469061afc4;hp=f94e3f4215621680768e24eaaacb9e312f8d34aa;hpb=c27693ac87a6a64a63d410f3e0cd9aa00cf7841a;p=plcapi.git diff --git a/tests/0CharsetTest.php b/tests/0CharsetTest.php index f94e3f4..549b0f4 100644 --- a/tests/0CharsetTest.php +++ b/tests/0CharsetTest.php @@ -15,8 +15,9 @@ use PhpXmlRpc\Helper\Charset; * chcp 28591 (latin1) * chcp 65001 (utf8) * - * @todo add tests for conversion: utf8 -> ascii + * @todo add tests for conversion: utf8 -> ascii (incl. chars 0-31) * @todo add tests for conversion: latin1 -> utf8 + * @todo add tests for conversion: latin1 -> ascii */ class CharsetTest extends PhpXmlRpc_PolyfillTestCase { @@ -49,6 +50,15 @@ class CharsetTest extends PhpXmlRpc_PolyfillTestCase ); } + protected function utf8ToAscii($data) + { + return Charset::instance()->encodeEntities( + $data, + 'UTF-8', + 'US-ASCII' + ); + } + public function testUtf8ToLatin1All() { /*$this->assertEquals(