Skip to content

Commit 9c1c123

Browse files
author
Alexander
committed
Issue #94 UTF8Utils::countChars() - extra bad perfomance with iconv_strlen()
1 parent 97f171b commit 9c1c123

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/HTML5/Parser/UTF8Utils.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@ class UTF8Utils
4848
public static function countChars($string)
4949
{
5050
// Get the length for the string we need.
51-
if (function_exists('iconv_strlen')) {
52-
return iconv_strlen($string, 'utf-8');
53-
} elseif (function_exists('mb_strlen')) {
51+
if (function_exists('mb_strlen')) {
5452
return mb_strlen($string, 'utf-8');
5553
} elseif (function_exists('utf8_decode')) {
5654
// MPB: Will this work? Won't certain decodes lead to two chars

0 commit comments

Comments
 (0)