summaryrefslogtreecommitdiff
path: root/src/HTML5/Parser
diff options
context:
space:
mode:
authorAlexander <[email protected]>2016-01-26 11:57:11 +0200
committerAlexander <[email protected]>2016-01-26 11:57:11 +0200
commit9c1c1238dd9f711cec5c63fc5cd2fa8262380c9d (patch)
tree5b7c78c4e9c897e693ae21beb01fe734b02145f1 /src/HTML5/Parser
parent97f171b03414bea826fabf4ae8f9191f0320316f (diff)
Issue #94 UTF8Utils::countChars() - extra bad perfomance with iconv_strlen()
Diffstat (limited to 'src/HTML5/Parser')
-rw-r--r--src/HTML5/Parser/UTF8Utils.php4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/HTML5/Parser/UTF8Utils.php b/src/HTML5/Parser/UTF8Utils.php
index d319252..9afb5ea 100644
--- a/src/HTML5/Parser/UTF8Utils.php
+++ b/src/HTML5/Parser/UTF8Utils.php
@@ -48,9 +48,7 @@ class UTF8Utils
public static function countChars($string)
{
// Get the length for the string we need.
- if (function_exists('iconv_strlen')) {
- return iconv_strlen($string, 'utf-8');
- } elseif (function_exists('mb_strlen')) {
+ if (function_exists('mb_strlen')) {
return mb_strlen($string, 'utf-8');
} elseif (function_exists('utf8_decode')) {
// MPB: Will this work? Won't certain decodes lead to two chars