summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChristian Schneider2018-01-18 18:43:40 +0100
committerChristian Schneider2018-01-18 18:43:40 +0100
commit960b387c66c0126f862e21d5c2b56fa17e399b75 (patch)
tree71338d0939dfb4bc742bfcef98e63136636689a9 /tests
parent50485bf9d9243693514ace67e9931a6c24947333 (diff)
downloaditools-960b387c66c0126f862e21d5c2b56fa17e399b75.tar.gz
itools-960b387c66c0126f862e21d5c2b56fa17e399b75.tar.bz2
itools-960b387c66c0126f862e21d5c2b56fa17e399b75.zip
Normalize combining diaeresis to umlaut in it::any2utf8()
Diffstat (limited to 'tests')
-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);