summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUrban Müller2012-04-20 10:07:09 +0000
committerUrban Müller2012-04-20 10:07:09 +0000
commit4de9c124f28b2f17b7b5b571fb4a1be81bfbbdc8 (patch)
tree2f333741df465f2535fa136aabc5e2def1b677f7
parenta71aef9ea211dd0edd1718e4a68c027e94e11623 (diff)
downloaditools-4de9c124f28b2f17b7b5b571fb4a1be81bfbbdc8.tar.gz
itools-4de9c124f28b2f17b7b5b571fb4a1be81bfbbdc8.tar.bz2
itools-4de9c124f28b2f17b7b5b571fb4a1be81bfbbdc8.zip
fix double encodings in any2utf8
-rw-r--r--it.class5
1 files changed, 4 insertions, 1 deletions
diff --git a/it.class b/it.class
index d08268d..5ff09fd 100644
--- a/it.class
+++ b/it.class
@@ -412,7 +412,10 @@ static function grep($pattern, $array, $p = array())
*/
function any2utf8($value)
{
- return grapheme_strlen($value) === null ? utf8_encode($value) : $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
}
/**