You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The JSON string "\ud83d\udc95" has one codepoint, not two.
This is because the spec allows extended characters to be encoded as a pair of 16-bit values, called a "surrogate pair".
From RFC 4627:
To escape an extended character that is not in the Basic Multilingual
Plane, the character is represented as a twelve-character sequence,
encoding the UTF-16 surrogate pair. So, for example, a string
containing only the G clef character (U+1D11E) may be represented as
"\uD834\uDD1E".
But SWI-Prolog's JSON parser reads that string as two (invalid) characters.
I have fixed this in my fork and will submit a pull request.
The text was updated successfully, but these errors were encountered:
mbrock
added a commit
to mbrock/swipl-http
that referenced
this issue
Mar 1, 2023
The JSON string "\ud83d\udc95" has one codepoint, not two.
This is because the spec allows extended characters to be
encoded as a pair of 16-bit values, called a "surrogate pair".
From RFC 4627:
> To escape an extended character that is not in the Basic Multilingual
> Plane, the character is represented as a twelve-character sequence,
> encoding the UTF-16 surrogate pair. So, for example, a string
> containing only the G clef character (U+1D11E) may be represented as
> "\uD834\uDD1E".
This commit fixes the JSON parser to handle such surrogate pairs.
The JSON string "\ud83d\udc95" has one codepoint, not two.
This is because the spec allows extended characters to be
encoded as a pair of 16-bit values, called a "surrogate pair".
From RFC 4627:
> To escape an extended character that is not in the Basic Multilingual
> Plane, the character is represented as a twelve-character sequence,
> encoding the UTF-16 surrogate pair. So, for example, a string
> containing only the G clef character (U+1D11E) may be represented as
> "\uD834\uDD1E".
This commit fixes the JSON parser to handle such surrogate pairs.
The JSON string
"\ud83d\udc95"
has one codepoint, not two.This is because the spec allows extended characters to be encoded as a pair of 16-bit values, called a "surrogate pair".
From RFC 4627:
But SWI-Prolog's JSON parser reads that string as two (invalid) characters.
I have fixed this in my fork and will submit a pull request.
The text was updated successfully, but these errors were encountered: