Open ali-abrar opened 5 years ago
This is the replacement Data.Text does: https://hackage.haskell.org/package/text-1.2.4.0/docs/Data-Text-Internal.html#v:safe
Can confirm that this is an issue that is impacting a production codebase. Would be great if we could get a fix.
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:
As you can see, it doesn't roundtrip. By comparison, fromCodePoint and codePointAt in JavaScript do roundtrip on this value.