text-cp437: Conversion of Text to and from CP437

[ bsd3, library, text ] [ Propose Tags ] [ Report a vulnerability ]

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]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.2.0.0, 0.2.1, 0.2.2
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 2019-07-24T17:30:54Z
Distributions NixOS:0.2.2
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 1988 total (16 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2019-07-24 [all 1 reports]

Readme for text-cp437-0.2.2

[back to package description]

text-cp437

Basic mapping of cp437 bytes to UTF and back.

  • Data.Text.CP437 offers mapping that maps control characters to control characters.
  • Data.Text.CP437.Graphical maps control characters to old school pictures like .

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.