dataenc-0.13.0.1: Data encoding librarySource codeContentsIndex
Codec.Binary.PythonString
Description

Implementation of python escaping.

This implementation encodes non-printable characters (0x00-0x1f, 0x7f-0xff) to hex-value characters ('\xhh') while leaving printable characters as such:

 > encode [0, 10, 13, 110]
 "\\x00\\x0A\\x0Dn"
 > putStrLn $ encode [0, 10, 13, 110]
 \x00\x0A\x0Dn

It also properly handles escaping of a few characters that require it:

 > encode [34, 39, 92]
 "\\\"\\'\\\\"
 putStrLn $ encode [34, 39, 92]
 \"\'\\

Further documentation and information can be found at http://www.haskell.org/haskellwiki/Library/Data_encoding.

Synopsis
encode :: [Word8] -> String
decode :: String -> Maybe [Word8]
decode' :: String -> [Maybe Word8]
chop :: Int -> String -> [String]
unchop :: [String] -> String
Documentation
encode :: [Word8] -> StringSource
Encode data.
decode :: String -> Maybe [Word8]Source
Decode data (strict).
decode' :: String -> [Maybe Word8]Source
chopSource
:: Intlength of individual lines (values < 1 are ignored)
-> String
-> [String]
Chop up a string in parts.
unchop :: [String] -> StringSource
Concatenate the list of strings into one long string.
Produced by Haddock version 2.4.2