text-cp437: Conversion of Text to and from CP437

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]

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]

Properties

Versions 0.2.0.0, 0.2.0.0, 0.2.1, 0.2.2
Change log None available
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 2017-08-23T17:18:44Z

Modules

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Readme for text-cp437-0.2.0.0

[back to package description]

text-cp437

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.