From b165f909a36748f0d749c250cdba3006ccd23105 Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Wed, 11 Sep 2019 17:45:06 +0200 Subject: add params2utf8 tests --- test/it.t | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/it.t b/test/it.t index af11b94..cc3e9f2 100755 --- a/test/it.t +++ b/test/it.t @@ -481,3 +481,16 @@ is(ob_get_clean(), "aa"); it::file_put($tmpfile, "bb"); is(it::file_get($tmpfile), "bb"); unlink($tmpfile); + +requesturi(utf8_decode("lüönd"), "lüönd"); +requesturi(utf8_decode("ü").utf8_encode("ü"), "üü"); +requesturi(utf8_encode("müller"), "müller"); +requesturi(utf8_encode(utf8_encode("müller")), "müller"); +requesturi("I 💚 Nü York", "I 💚 Nü York"); + +function requesturi($teststring, $expect) +{ + $_SERVER['REQUEST_URI'] = urlencode($teststring); + it::params2utf8(); + is(urldecode($_SERVER['REQUEST_URI']), $expect, "parms2utf8('$expect')"); +} -- cgit v1.2.3