text-cp437-0.2.2: Conversion of Text to and from CP437

Copyright(c) 2018 Ignat Insarov
LicenseBSD-style
Maintainerkindaro@gmail.com
Stabilityexperimental
PortabilityGHC
Safe HaskellSafe
LanguageHaskell2010

Data.Text.CP437.Graphical

Contents

Description

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

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.

Char/Word8

utfToByte :: Char -> Word8 Source #

Convert a single unicode character to a CP-437 byte.

byteToUtf :: Word8 -> Char Source #

Convert a single byte into a unicode character.