diff --git a/composer.json b/composer.json index b147d6a7..c95977c3 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,8 @@ "homepage": "https://www.sabberworm.com/blog/2010/6/10/php-css-parser", "require": { "php": "^7.2.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0", - "ext-iconv": "*" + "ext-iconv": "*", + "ext-mbstring": "*" }, "require-dev": { "php-parallel-lint/php-parallel-lint": "1.4.0", diff --git a/src/Parsing/ParserState.php b/src/Parsing/ParserState.php index c14674d2..02bab779 100644 --- a/src/Parsing/ParserState.php +++ b/src/Parsing/ParserState.php @@ -202,7 +202,7 @@ public function parseCharacter($bIsForIdentifier) $sUtf32 .= \chr($iUnicode & 0xff); $iUnicode = $iUnicode >> 8; } - return \iconv('utf-32le', $this->sCharset, $sUtf32); + return mb_convert_encoding($sUtf32 , $this->sCharset , 'UTF-32LE'); } if ($bIsForIdentifier) { $peek = \ord($this->peek());