Page MenuHomePhabricator

CSSMin::serializeStringValue breaks some UTF-8 characters
Closed, ResolvedPublic

Description

CSSMin::serializeStringValue breaks some UTF-8 characters:

> print CSSMin::serializeStringValue('ä')
"ä"
> print CSSMin::serializeStringValue('Ä')
"�\84 "

The reason is that CSSMin::serializeStringValue escapes the bytes 0x80 to 0x9f instead of the Unicode code points U+0080 to U+009F as required in the specification for CSS string serialization (https://www.w3.org/TR/2013/WD-cssom-20131205/#serialize-a-string). In UTF-8 this breaks the UTF-8 encoding.

The current specification for CSS string serialization (https://www.w3.org/TR/2016/WD-cssom-1-20160317/#serialize-a-string) does not require to escape the Unicode code points U+0080 to U+009F anymore.

Event Timeline

Change 425469 had a related patch set uploaded (by Fomafix; owner: Fomafix):
[mediawiki/core@master] CSSMin::serializeStringValue: Update implementation to new specification

https://gerrit.wikimedia.org/r/425469

Change 425469 merged by jenkins-bot:
[mediawiki/core@master] CSSMin::serializeStringValue: Update implementation to new specification

https://gerrit.wikimedia.org/r/425469