-
Notifications
You must be signed in to change notification settings - Fork 13
Closed
Description
The following line fails with the error "*** Exception: More data - lexer failed.". Note the single-quote that is actually codepoint 180, acute accent.
> parseLazyByteString JSP.string (BS.pack "\"asdfasdf bob´s burgers\"")
*** Exception: More data - lexer failed.
-- compare with
> parseLazyByteString JSP.string (BS.pack "\"asdfasdf bob's burgers\"")
["asdfasdf bob's burgers"]
This error is fixed by doing the following:
escapeUTF8 [] = []
escapeUTF8 (c:str) = case ord c of
x | x < 128 -> c : (escapeUTF8 str)
| otherwise -> '\\' : 'u' : (printf "%04x" x ++ escapeUTF8 str)
> parseLazyByteString JSP.string (BS.pack . escapeUTF8 $ "\"asdfasdf bob´s burgers\"")
["asdfasdf bob\180s burgers"]
I've briefly looked through the source, but with my limited familiarity I don't see any obvious place for the internal parsing to have fallen down on this input.
Metadata
Metadata
Assignees
Labels
No labels