haskell / alex

A lexical analyser generator for Haskell
https://hackage.haskell.org/package/alex
BSD 3-Clause "New" or "Revised" License
298 stars 82 forks source link

Feature request: Add support for UTF8 bytestring wrappers (utf8-bytestring-basic, utf8-bytestring-posn...) #192

Open notYuriy opened 3 years ago

notYuriy commented 3 years ago

Alex wrappers have UTF8 encoding logic for wrappers that operate on haskell strings. I think it shouldn't be too difficuilt to add UTF8 bytestrings wrappers (for Data.ByteString.Lazy.UTF8.ByteString type) that will encode UTF8 chars in a similar fashion

notYuriy commented 3 years ago

The type is provided in utf8-bytestring package

https://hackage.haskell.org/package/utf8-string-1.0.2/docs/Data-ByteString-Lazy-UTF8.html