From 9de3207870c86ca6b99e6b24956d3ea3f62cbc9d Mon Sep 17 00:00:00 2001 From: Fabian Blechschmidt Date: Wed, 22 Sep 2021 16:09:41 +0200 Subject: [PATCH 1/3] Fixes #431 --- src/Parsing/ParserState.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Parsing/ParserState.php b/src/Parsing/ParserState.php index 2dda8c84..abc9121c 100644 --- a/src/Parsing/ParserState.php +++ b/src/Parsing/ParserState.php @@ -175,7 +175,7 @@ public function parseCharacter($bIsForIdentifier) $sUtf32 .= chr($iUnicode & 0xff); $iUnicode = $iUnicode >> 8; } - return iconv('utf-32le', $this->sCharset, $sUtf32); + mb_convert_encoding($sUtf32 , $this->sCharset , 'UTF-32LE'); } if ($bIsForIdentifier) { $peek = ord($this->peek()); From ed4d37fd9e86e4875f3208dbf99b55fecf16bd80 Mon Sep 17 00:00:00 2001 From: Fabian Blechschmidt Date: Fri, 31 Jan 2025 09:48:32 +0100 Subject: [PATCH 2/3] add missing return --- src/Parsing/ParserState.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Parsing/ParserState.php b/src/Parsing/ParserState.php index abc9121c..53332dbe 100644 --- a/src/Parsing/ParserState.php +++ b/src/Parsing/ParserState.php @@ -175,7 +175,7 @@ public function parseCharacter($bIsForIdentifier) $sUtf32 .= chr($iUnicode & 0xff); $iUnicode = $iUnicode >> 8; } - mb_convert_encoding($sUtf32 , $this->sCharset , 'UTF-32LE'); + return mb_convert_encoding($sUtf32 , $this->sCharset , 'UTF-32LE'); } if ($bIsForIdentifier) { $peek = ord($this->peek()); From 49ee98ddf364d7e05ddb932ad4c22c243b26efad Mon Sep 17 00:00:00 2001 From: Fabian Blechschmidt Date: Mon, 3 Feb 2025 16:43:35 +0100 Subject: [PATCH 3/3] Add mbstring dependency to composer.json --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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",