summaryrefslogtreecommitdiff
path: root/it.class
diff options
context:
space:
mode:
Diffstat (limited to 'it.class')
-rw-r--r--it.class3
1 files changed, 1 insertions, 2 deletions
diff --git a/it.class b/it.class
index 937cde7..714ffc4 100644
--- a/it.class
+++ b/it.class
@@ -533,8 +533,7 @@ static function any2utf8($value, $errprefix = "")
if (preg_match('/\xef\xb7[\x90-\xaf]|\xef\xbf[\xbe\xbf]/', $value))
list($value, $error) = array(preg_replace('/\xef\xb7[\x90-\xaf]|\xef\xbf[\xbe\xbf]/', " ", $value), "forbidden utf-8 character. input=$value");
$value = preg_replace('/\xc2\xad/', '', $value); # Kill invisible soft hyphens
- if (preg_match('/\xcc\x88/', $value)) # Normalize combining diaeresis to umlaut
- $value = strtr($value, [ "a\xcc\x88" => 'ä', "A\xcc\x88" => 'Ä', "e\xcc\x88" => 'ë', "E\xcc\x88" => 'Ë', "i\xcc\x88" => 'ï', "I\xcc\x88" => 'Ï', "o\xcc\x88" => 'ö', "O\xcc\x88" => 'Ö', "u\xcc\x88" => 'ü', "U\xcc\x88" => 'Ü' ]);
+ $value = normalizer_normalize($value, Normalizer::FORM_C);
if ($error && $errprefix)
it::error(array('title' => "$errprefix: " . trim($error)));
}