Skip to content

Conversation

@spencerjanssen
Copy link
Contributor

Notably fixes an issue in the contact update form where names with non-ASCII characters were mangled.

Fixes #1339

Notably fixes an issue in the contact update form where names with
non-ASCII characters were mangled.

Fixes haskell#1339
parseJVal s = JSON.decode (BS8.pack s)
parseJVal s | [(str,"")] <- reads (T.unpack s) = Just (JSON.String (T.pack str))
parseJVal s | [(n, "")] <- reads (T.unpack s) = Just (JSON.Number (fromIntegral (n :: Int)))
parseJVal s = JSON.decodeStrict (encodeUtf8 s)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this last case we've gone from ByteString to Text and back to ByteString. Redundant, but harmless and simplifies the surrounding code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

User name may be mangled if not ASCII

1 participant