Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

decode*With functions allow inclusion of invalid characters in the final result #20

Closed
jmillikin opened this Issue · 1 comment

2 participants

@jmillikin

The decoding functions like decodeUtf8With allow Text values to be constructed with invalid codepoints:

> decodeUtf8With (\_ -> fmap (\w -> chr (fromIntegral w + 0xDC00))) (Data.ByteString.Char8.pack "\227\129\130\187\227\129\130")
"\12354\56507\12354"

> Data.Text.pack "\12354\56507\12354"
"\12354\65533\12354"

Here, the codepoint U+DCBB is present in the decoded value even though it's reserved. If I try to run the same codepoints through pack, they are converted to the placeholder character.

@bos
Owner

Fixed by 1780bd7, thanks.

@bos bos closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.