-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | A library for various character encodings
--
-- Haskell has excellect handling of unicode, the Char type covers all
-- unicode chars. Unfortunatly, there's no possibility to read or write
-- something to the outer world in an encoding other than ascii due to
-- the lack of support for encodings. This library should help with that.
@package encoding
@version 0.4.1
-- | ASCII (American Standard Code for Information Interchange) is the
-- "normal" computer encoding using the byte values 0-127 to represent
-- characters. Refer to http://en.wikipedia.org/wiki/ASCII for
-- more information.
module Data.Encoding.ASCII
data ASCII
ASCII :: ASCII
instance Typeable ASCII
instance Show ASCII
instance Eq ASCII
instance Encoding ASCII
-- | This module implements UTF-8 encoding and decoding as in RFC 3629. See
-- http://en.wikipedia.org/wiki/UTF-8 for more information.
module Data.Encoding.UTF8
data UTF8
-- | Very forgiving decoding mechanism, accepts everything that it can make
-- any sense of.
UTF8 :: UTF8
-- | More strict decoding, doesn't accept sequences that have a too long
-- representation and checks bits that aren't used in the decoding.
UTF8Strict :: UTF8
instance Typeable UTF8
instance Eq UTF8AnalyzeState
instance Eq UTF8
instance Show UTF8
instance Encoding UTF8
-- | This module implements UTF-16 encoding and decoding as in RFC 2781.
-- See http://en.wikipedia.org/wiki/UTF-16 for more information.
module Data.Encoding.UTF16
data UTF16
-- | Decodes big and little endian, encodes big endian.
UTF16 :: UTF16
-- | Big endian decoding and encoding, fails if the string isn't actually
-- big endian.
UTF16BE :: UTF16
-- | Little endian decoding and encoding.
UTF16LE :: UTF16
instance Typeable UTF16
instance Eq UTF16
instance Show UTF16
instance Encoding UTF16
-- | This module implements UTF-32 encoding and decoding. See
-- http://en.wikipedia.org/wiki/UTF-32 for more information.
module Data.Encoding.UTF32
data UTF32
-- | Detects big or little endian through the use of the BOM (Byte Order
-- Mask) character. Defaults to big endian if not present.
UTF32 :: UTF32
-- | Encodes and decodes using the big endian encoding.
UTF32BE :: UTF32
-- | Encodes and decodes using the little endian encoding.
UTF32LE :: UTF32
instance Typeable UTF32
instance Eq UTF32
instance Show UTF32
instance Encoding UTF32
-- | Implements ISO/IEC 8859-1 alias latin-1 encoding. See
-- http://en.wikipedia.org/wiki/ISO/IEC_8859-1 for further
-- information.
module Data.Encoding.ISO88591
data ISO88591
ISO88591 :: ISO88591
instance Typeable ISO88591
instance Eq ISO88591
instance Show ISO88591
instance Encoding ISO88591
-- | Implements ISO/IEC 8859-2 alias latin-2 encoding. See
-- http://en.wikipedia.org/wiki/ISO/IEC_8859-2 for further
-- informations.
module Data.Encoding.ISO88592
data ISO88592
ISO88592 :: ISO88592
instance Typeable ISO88592
instance Eq ISO88592
instance Show ISO88592
instance Encoding ISO88592
-- | Implements ISO 8859-3 encoding, alias latin-3, alias south european
module Data.Encoding.ISO88593
data ISO88593
ISO88593 :: ISO88593
instance Typeable ISO88593
instance Eq ISO88593
instance Show ISO88593
instance Encoding ISO88593
module Data.Encoding.ISO88594
data ISO88594
ISO88594 :: ISO88594
instance Typeable ISO88594
instance Eq ISO88594
instance Show ISO88594
instance Encoding ISO88594
module Data.Encoding.ISO88595
data ISO88595
ISO88595 :: ISO88595
instance Typeable ISO88595
instance Eq ISO88595
instance Show ISO88595
instance Encoding ISO88595
module Data.Encoding.ISO88596
data ISO88596
ISO88596 :: ISO88596
instance Typeable ISO88596
instance Eq ISO88596
instance Show ISO88596
instance Encoding ISO88596
module Data.Encoding.ISO88597
data ISO88597
ISO88597 :: ISO88597
instance Typeable ISO88597
instance Eq ISO88597
instance Show ISO88597
instance Encoding ISO88597
module Data.Encoding.ISO88598
data ISO88598
ISO88598 :: ISO88598
instance Typeable ISO88598
instance Eq ISO88598
instance Show ISO88598
instance Encoding ISO88598
module Data.Encoding.ISO88599
data ISO88599
ISO88599 :: ISO88599
instance Typeable ISO88599
instance Eq ISO88599
instance Show ISO88599
instance Encoding ISO88599
module Data.Encoding.ISO885910
data ISO885910
ISO885910 :: ISO885910
instance Typeable ISO885910
instance Eq ISO885910
instance Show ISO885910
instance Encoding ISO885910
module Data.Encoding.ISO885911
data ISO885911
ISO885911 :: ISO885911
instance Typeable ISO885911
instance Eq ISO885911
instance Show ISO885911
instance Encoding ISO885911
module Data.Encoding.ISO885913
data ISO885913
ISO885913 :: ISO885913
instance Typeable ISO885913
instance Eq ISO885913
instance Show ISO885913
instance Encoding ISO885913
module Data.Encoding.ISO885914
data ISO885914
ISO885914 :: ISO885914
instance Typeable ISO885914
instance Eq ISO885914
instance Show ISO885914
instance Encoding ISO885914
module Data.Encoding.ISO885915
data ISO885915
ISO885915 :: ISO885915
instance Typeable ISO885915
instance Eq ISO885915
instance Show ISO885915
instance Encoding ISO885915
module Data.Encoding.ISO885916
data ISO885916
ISO885916 :: ISO885916
instance Typeable ISO885916
instance Eq ISO885916
instance Show ISO885916
instance Encoding ISO885916
-- | This module implements Windows Codepage number 1250 which encodes
-- languages that use latin script. See
-- http://en.wikipedia.org/wiki/CP1250 for more information.
module Data.Encoding.CP1250
data CP1250
CP1250 :: CP1250
instance Typeable CP1250
instance Eq CP1250
instance Show CP1250
instance Encoding CP1250
-- | This module implements Windows Codepage number 1251 which encodes
-- languages that use the cyrillic alphabet. See
-- http://en.wikipedia.org/wiki/CP1251 for more information.
module Data.Encoding.CP1251
data CP1251
CP1251 :: CP1251
instance Typeable CP1251
instance Eq CP1251
instance Show CP1251
instance Encoding CP1251
-- | This module implements Windows Codepage number 1252 which is a
-- superset of ISO 8859-1. See http://en.wikipedia.org/wiki/CP1252
-- for more information.
module Data.Encoding.CP1252
data CP1252
CP1252 :: CP1252
instance Typeable CP1252
instance Eq CP1252
instance Show CP1252
instance Encoding CP1252
-- | This module implements Windows Codepage number 1253 which encodes
-- modern greek. See http://en.wikipedia.org/wiki/CP1253 for more
-- information.
module Data.Encoding.CP1253
data CP1253
CP1253 :: CP1253
instance Typeable CP1253
instance Eq CP1253
instance Show CP1253
instance Encoding CP1253
-- | This module implements Windows Codepage number 1254 which encodes the
-- turkish language. See http://en.wikipedia.org/wiki/CP1254 for
-- more information.
module Data.Encoding.CP1254
data CP1254
CP1254 :: CP1254
instance Typeable CP1254
instance Eq CP1254
instance Show CP1254
instance Encoding CP1254
-- | This module implements Windows Codepage number 1255 which encodes the
-- hebrew language. See http://en.wikipedia.org/wiki/CP1255 for
-- more information.
module Data.Encoding.CP1255
data CP1255
CP1255 :: CP1255
instance Typeable CP1255
instance Eq CP1255
instance Show CP1255
instance Encoding CP1255
-- | This module implements Windows Codepage number 1256 which encodes
-- languages which use the arabic script. See
-- http://en.wikipedia.org/wiki/CP1256 for more information.
module Data.Encoding.CP1256
data CP1256
CP1256 :: CP1256
instance Typeable CP1256
instance Eq CP1256
instance Show CP1256
instance Encoding CP1256
-- | This module implements Windows Codepage number 1257 which encodes the
-- estonian, latvian and lithuanian language. See
-- http://en.wikipedia.org/wiki/CP1257 for more information.
module Data.Encoding.CP1257
data CP1257
CP1257 :: CP1257
instance Typeable CP1257
instance Eq CP1257
instance Show CP1257
instance Encoding CP1257
-- | This module implements Windows Codepage number 1258 which encodes the
-- vietnamese language. See http://en.wikipedia.org/wiki/CP1258
-- for more information.
module Data.Encoding.CP1258
data CP1258
CP1258 :: CP1258
instance Typeable CP1258
instance Eq CP1258
instance Show CP1258
instance Encoding CP1258
-- | This module implements KOI8-R encoding which covers the russian and
-- bulgarian alphabet. See http://en.wikipedia.org/wiki/KOI8-R for
-- more information.
module Data.Encoding.KOI8R
data KOI8R
KOI8R :: KOI8R
instance Typeable KOI8R
instance Eq KOI8R
instance Show KOI8R
instance Encoding KOI8R
-- | This module implements KOI8-U encoding which covers the ukrainian
-- alphabet. See http://en.wikipedia.org/wiki/KOI8-U for more
-- information.
module Data.Encoding.KOI8U
data KOI8U
KOI8U :: KOI8U
instance Typeable KOI8U
instance Eq KOI8U
instance Show KOI8U
instance Encoding KOI8U
-- | GB18030 is a chinese character encoding that is mandatory in china (if
-- you - don't implement it, you're not allowed to sell your software
-- there).
module Data.Encoding.GB18030
data GB18030
GB18030 :: GB18030
instance Typeable GB18030
instance Eq DecodingState
instance Eq GB18030
instance Show GB18030
instance Encoding GB18030
-- | This implements BootString en- and decoding, the foundation of
-- Punycode
module Data.Encoding.BootString
data BootString
BootString :: Int -> Int -> Int -> Int -> Int -> Int -> Int -> BootString
base :: BootString -> Int
tmin :: BootString -> Int
tmax :: BootString -> Int
skew :: BootString -> Int
damp :: BootString -> Int
init_bias :: BootString -> Int
init_n :: BootString -> Int
punycode :: BootString
instance Typeable BootString
instance Show BootString
instance Eq BootString
instance Encoding BootString
module Data.Encoding
-- | Represents an encoding, supporting various methods of de- and
-- encoding. Minimal complete definition: encode, decode
class Encoding enc
encode :: (Encoding enc) => enc -> String -> ByteString
encodeLazy :: (Encoding enc) => enc -> String -> ByteString
encodable :: (Encoding enc) => enc -> Char -> Bool
decode :: (Encoding enc) => enc -> ByteString -> String
decodeLazy :: (Encoding enc) => enc -> ByteString -> String
decodable :: (Encoding enc) => enc -> ByteString -> Bool
-- | This exception type is thrown whenever something went wrong during the
-- encoding-process.
data EncodingException
-- | Thrown if a specific character is not representable in an encoding.
HasNoRepresentation :: Char -> EncodingException
-- | This exception type is thrown whenever something went wrong during the
-- decoding-process.
data DecodingException
-- | The sequence contained an illegal byte that couldn't be decoded.
IllegalCharacter :: Word8 -> DecodingException
-- | more bytes were needed to allow a successfull decoding.
UnexpectedEnd :: DecodingException
-- | the decoded value was out of the unicode range
OutOfRange :: DecodingException
-- | The character sequence encodes a character, but is illegal.
IllegalRepresentation :: [Word8] -> DecodingException
-- | This decodes a string from one encoding and encodes it into another.
recode :: (Encoding from, Encoding to) => from -> to -> ByteString -> ByteString
recodeLazy :: (Encoding from, Encoding to) => from -> to -> ByteString -> ByteString
-- | An untyped encoding. Used in
-- System.IO.Encoding.getSystemEncoding.
data DynEncoding
-- | Takes the name of an encoding and creates a dynamic encoding from it.
encodingFromString :: String -> DynEncoding
-- | Like encodingFromString but returns Nothing instead of
-- throwing an error
encodingFromStringMaybe :: String -> Maybe DynEncoding
instance Eq DynEncoding
instance Show DynEncoding
instance Encoding DynEncoding
module System.IO.Encoding
-- | Returns the encoding used on the current system.
getSystemEncoding :: IO DynEncoding
-- | Like the normal System.IO.hPutStr, but encodes the output
-- using an encoding.
hPutStr :: (Encoding e) => e -> Handle -> String -> IO ()
-- | Like the normal System.IO.hGetContents, but decodes the input
-- using an encoding.
hGetContents :: (Encoding e) => e -> Handle -> IO String