MIT licensed and maintained by Michael Williams
This version can be pinned in stack with:zenacy-unicode-1.0.1@sha256:c4d7fe34ff403382de9b3e4c40d70b23535881f8ea079b7f44e1be4504a9a1c7,1655

Module documentation for 1.0.1

Zenacy Unicode

hackage-shield stackage-shield linux-shield packdeps-shield

Zenacy Unicode includes tools for checking byte order marks (BOM) and cleaning data to remove invalid bytes. These tools can help ensure that data pulled from the web can be parsed and converted to text.

The following is an example of converting dubious data to a text.

textDecode :: ByteString -> Text
textDecode b =
  case bomStrip b of
    (Nothing, s)           -> T.decodeUtf8 $ unicodeCleanUTF8 s -- Assume UTF8
    (Just BOM_UTF8, s)     -> T.decodeUtf8 $ unicodeCleanUTF8 s
    (Just BOM_UTF16_BE, s) -> T.decodeUtf16BE s
    (Just BOM_UTF16_LE, s) -> T.decodeUtf16LE s
    (Just BOM_UTF32_BE, s) -> T.decodeUtf32BE s
    (Just BOM_UTF32_LE, s) -> T.decodeUtf32LE s

Changes

Change Log

1.0.1

  • Upgrade bytestring dependency

1.0.0

  • Initial FOSS release