Copyright | (c) 2018 Ignat Insarov |
---|---|
License | BSD-style |
Maintainer | kindaro@gmail.com |
Stability | experimental |
Portability | GHC |
Safe Haskell | Safe |
Language | Haskell2010 |
Simple conversion of Unicode Text to and from code page 437, with printable glyphs for the whole range. Our design choice is to print 0x00 as a space.
Unrepresentable unicode characters are converted to a null byte.
Synopsis
- textToCp437 :: Text -> ByteString
- cp437ToText :: ByteString -> Text
- utfToByte :: Char -> Word8
- byteToUtf :: Word8 -> Char
Text/ByteString
textToCp437 :: Text -> ByteString Source #
Given a string of text, produce a bytestring containing valid CP-437 encoded data. If any UTF symbols are used that occur in CP437 they will be translated.
cp437ToText :: ByteString -> Text Source #
Given a ByteString that is encoded with CP-437, will decode to a UTF Text, with all symbols converted.