summaryrefslogtreecommitdiff
path: root/tests/it.t
diff options
context:
space:
mode:
Diffstat (limited to 'tests/it.t')
-rwxr-xr-xtests/it.t10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/it.t b/tests/it.t
index 22826a6..0da8768 100755
--- a/tests/it.t
+++ b/tests/it.t
@@ -414,6 +414,16 @@ is(it::any2utf8(array("foo", array(utf8_decode("bär")))), array("foo", array("b
is(it::any2utf8(array(1, true, false, null)), array(1, true, false, null), "any2utf8 should leave types alone");
is(it::any2utf8(array(utf8_decode('Müller') => utf8_decode('Müller'))), array('Müller' => 'Müller'), "it::any2utf8 latin1 keys");
+is(it::any2utf8("\xc2\xad"), "", "it::any2utf8 remove soft hyphens");
+
+foreach ([ 'a' => 'ä', 'e' => 'ë', 'i' => 'ï', 'o' => 'ö', 'u' => 'ü' ] as $src => $dst)
+{
+ is(it::any2utf8("$src\xcc\x88"), $dst, "it::any2utf8 normalize combining diaeresis $dst to umlaut code $dst");
+ $src = mb_strtoupper($src);
+ $dst = mb_strtoupper($dst);
+ is(it::any2utf8("$src\xcc\x88"), $dst, "it::any2utf8 normalize combining diaeresis $dst to umlaut code $dst");
+}
+
foreach (array($dummy, false, true, null, 1, "a", "Ä", "/", array()) as $var)
is(it::json_decode(it::json_encode($var)), $var);