X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=tests%2F3LocalhostTest.php;h=ca2e631c243e806158c733a845f8d003f8ee1079;hb=390edf48f54b0f0645cf7882146a9e117a2099c4;hp=186dd59c0a32ffe16fb1095466567e13cad2520f;hpb=fc4f17849d8bb022c3b8ff38a2bed1d1c188ac7f;p=plcapi.git diff --git a/tests/3LocalhostTest.php b/tests/3LocalhostTest.php index 186dd59..ca2e631 100644 --- a/tests/3LocalhostTest.php +++ b/tests/3LocalhostTest.php @@ -186,6 +186,30 @@ class LocalhostTest extends PHPUnit_Framework_TestCase } } + public function testExoticCharsetsRequests() + { + // note that we should disable this call also when mbstring is missing server-side + if (!function_exists('mb_convert_encoding')) { + $this->markTestSkipped('Miss mbstring extension to test exotic charsets'); + return; + } + $sendString = 'κόσμε'; // Greek word 'kosme'. NB: NOT a valid ISO8859 string! + $str = ' + + examples.stringecho + + + '.$sendString.' + + +'; + + $v = $this->send(mb_convert_encoding(str_replace('_ENC_', 'UCS-4', $str), 'UCS-4', 'UTF-8')); + $this->assertEquals($sendString, $v->scalarval()); + $v = $this->send(mb_convert_encoding(str_replace('_ENC_', 'UTF-16', $str), 'UTF-16', 'UTF-8')); + $this->assertEquals($sendString, $v->scalarval()); + } + /*public function testLatin1Method() { $f = new xmlrpcmsg("tests.iso88591methodname." . chr(224) . chr(252) . chr(232), array(