diff options
author | Christian Schneider | 2018-01-18 18:43:40 +0100 |
---|---|---|
committer | Christian Schneider | 2018-01-18 18:43:40 +0100 |
commit | 960b387c66c0126f862e21d5c2b56fa17e399b75 (patch) | |
tree | 71338d0939dfb4bc742bfcef98e63136636689a9 /tests | |
parent | 50485bf9d9243693514ace67e9931a6c24947333 (diff) | |
download | itools-960b387c66c0126f862e21d5c2b56fa17e399b75.tar.gz itools-960b387c66c0126f862e21d5c2b56fa17e399b75.tar.bz2 itools-960b387c66c0126f862e21d5c2b56fa17e399b75.zip |
Normalize combining diaeresis to umlaut in it::any2utf8()
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/it.t | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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); |