Open
Description
Data.Text performs a replacement on code points ["\55296" .. "\57343"] during certain operations (see this issue). Data.JSString, which uses JavaScript's builtin fromCodePoint
(available as of ECMAScript 6) does not do this replacement.
Here's the behavior of Data.Text:
Prelude T> T.pack ['\xD800']
"\65533"
Prelude T> print '\xD800'
'\55296'
Prelude T> T.unpack (T.pack ['\xD800'])
"\65533"
As you can see, it doesn't roundtrip. By comparison, fromCodePoint and codePointAt in JavaScript do roundtrip on this value.
Metadata
Assignees
Labels
No labels