text-cp437: Conversion of Text to and from CP437

[ bsd3, library, text ] [ Propose Tags ]
Versions, 0.2.1
Dependencies base (>=4.7 && <5), bytestring, text [details]
License BSD-3-Clause
Copyright (C) 2017 Christopher Lord (Pliosoft), All Rights Reserved
Author Christopher Lord
Maintainer christopher@pliosoft.com
Category Text
Home page https://github.com/pliosoft/text-cp437#readme
Bug tracker https://github.com/pliosoft/text-cp437/issues
Source repo head: git clone git@github.com:pliosoft/text-cp437.git
Uploaded by clord at Wed Aug 23 17:38:27 UTC 2017
Distributions NixOS:0.2.1
Downloads 328 total (7 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2017-08-23 [all 1 reports]
Hackage Matrix CI

Some devices such as receipt printers require text encoded in CP437. This library can help convert regular UTF symbols to and from this format. See https://en.wikipedia.org/wiki/Code_page_437

[Skip to Readme]




Maintainer's Corner

For package maintainers and hackage trustees

Readme for text-cp437-0.2.1

[back to package description]


Basic mapping of cp437 bytes to UTF and back.

textToCp437 :: Text -> ByteString

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

Given a ByteString that is encoded with CP-437, will decode to a UTF Text, with all symbols converted.

utfToByte :: Char -> Word8

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

byteToUtf :: Word8 -> Char

Convert a single byte into a unicode character.