summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--it.class2
-rwxr-xr-xtests/it.t2
2 files changed, 3 insertions, 1 deletions
diff --git a/it.class b/it.class
index 5ff09fd..b84c740 100644
--- a/it.class
+++ b/it.class
@@ -415,7 +415,7 @@ function any2utf8($value)
if (grapheme_strlen($value) === null)
$value = utf8_encode($value);
- return preg_replace('/\xc3\x83\xc2([\xbc\xa9\xa4\xb6\xa8\xa2\xa0\xb4\xaa\xa7\x84\xab\xae\x9c\xaf\x96\xb2\xbb\xb9\x9f])/', '\xc3$1', $value); # fix most common double encodings, UTF8SAFE
+ return preg_replace('/\xc3\x83\xc2([\xbc\xa9\xa4\xb6\xa8\xa2\xa0\xb4\xaa\xa7\x84\xab\xae\x9c\xaf\x96\xb2\xbb\xb9\x9f])/', "\xc3\$1", $value); # fix most common double encodings, UTF8SAFE
}
/**
diff --git a/tests/it.t b/tests/it.t
index 8e4a7e2..26a4e25 100755
--- a/tests/it.t
+++ b/tests/it.t
@@ -369,4 +369,6 @@ is(it::any2utf8(
' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ',
"it::any2utf8 latin1 input (exhaustive alphabet)");
+is(it::any2utf8(utf8_encode("ü")), "ü", "it::any2utf8 double encoding");
+
?>