Portability | non-portable |
---|---|
Stability | internal |
Maintainer | libraries@haskell.org |
Types for text encoding/decoding
- data BufferCodec from to state = BufferCodec {}
- data TextEncoding = forall dstate estate . TextEncoding {
- textEncodingName :: String
- mkTextDecoder :: IO (TextDecoder dstate)
- mkTextEncoder :: IO (TextEncoder estate)
- type TextEncoder state = BufferCodec CharBufElem Word8 state
- type TextDecoder state = BufferCodec Word8 CharBufElem state
- type EncodeBuffer = Buffer Char -> Buffer Word8 -> IO (CodingProgress, Buffer Char, Buffer Word8)
- type DecodeBuffer = Buffer Word8 -> Buffer Char -> IO (CodingProgress, Buffer Word8, Buffer Char)
- data CodingProgress
Documentation
data BufferCodec from to state Source
BufferCodec | |
|
data TextEncoding Source
A TextEncoding
is a specification of a conversion scheme
between sequences of bytes and sequences of Unicode characters.
For example, UTF-8 is an encoding of Unicode characters into a sequence
of bytes. The TextEncoding
for UTF-8 is utf8
.
forall dstate estate . TextEncoding | |
|
type TextEncoder state = BufferCodec CharBufElem Word8 stateSource
type TextDecoder state = BufferCodec Word8 CharBufElem stateSource
type EncodeBuffer = Buffer Char -> Buffer Word8 -> IO (CodingProgress, Buffer Char, Buffer Word8)Source
type DecodeBuffer = Buffer Word8 -> Buffer Char -> IO (CodingProgress, Buffer Word8, Buffer Char)Source
data CodingProgress Source
InputUnderflow | Stopped because the input contains insufficient available elements, or all of the input sequence has been sucessfully translated. |
OutputUnderflow | Stopped because the output contains insufficient free elements |
InvalidSequence | Stopped because there are sufficient free elements in the output to output at least one encoded ASCII character, but the input contains an invalid or unrepresentable sequence |