Copyright | (c) The University of Glasgow 2008-2009 |
---|---|
License | see libraries/base/LICENSE |
Maintainer | libraries@haskell.org |
Stability | internal |
Portability | non-portable |
Safe Haskell | Trustworthy |
Language | Haskell2010 |
Types for text encoding/decoding
Synopsis
- data BufferCodec from to state = BufferCodec {}
- data TextEncoding = 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 CodeBuffer from to = Buffer from -> Buffer to -> IO (CodingProgress, Buffer from, Buffer to)
- type EncodeBuffer = CodeBuffer Char Word8
- type DecodeBuffer = CodeBuffer Word8 Char
- data CodingProgress
Documentation
data BufferCodec from to state #
BufferCodec | |
|
data TextEncoding #
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
.
TextEncoding | |
|
Instances
Show TextEncoding # | Since: base-4.3.0.0 |
Defined in GHC.IO.Encoding.Types showsPrec :: Int -> TextEncoding -> ShowS # show :: TextEncoding -> String # showList :: [TextEncoding] -> ShowS # |
type TextEncoder state = BufferCodec CharBufElem Word8 state #
type TextDecoder state = BufferCodec Word8 CharBufElem state #
type CodeBuffer from to = Buffer from -> Buffer to -> IO (CodingProgress, Buffer from, Buffer to) #
type EncodeBuffer = CodeBuffer Char Word8 #
type DecodeBuffer = CodeBuffer Word8 Char #
data CodingProgress #
Since: base-4.4.0.0
InputUnderflow | Stopped because the input contains insufficient available elements, or all of the input sequence has been successfully 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 |
Instances
Eq CodingProgress # | Since: base-4.4.0.0 |
Defined in GHC.IO.Encoding.Types (==) :: CodingProgress -> CodingProgress -> Bool Source # (/=) :: CodingProgress -> CodingProgress -> Bool Source # | |
Show CodingProgress # | Since: base-4.4.0.0 |
Defined in GHC.IO.Encoding.Types showsPrec :: Int -> CodingProgress -> ShowS # show :: CodingProgress -> String # showList :: [CodingProgress] -> ShowS # |