Portability | portable |
---|---|
Stability | experimental |
Maintainer | bos@serpentine.com, rtomharper@googlemail.com, duncan@haskell.org |
Functions for converting lazy Text
values to and from lazy
ByteString
, using several standard encodings.
To make use of a much larger variety of encodings, use the text-icu
package.
- decodeASCII :: ByteString -> Text
- decodeUtf8 :: ByteString -> Text
- decodeUtf16LE :: ByteString -> Text
- decodeUtf16BE :: ByteString -> Text
- decodeUtf32LE :: ByteString -> Text
- decodeUtf32BE :: ByteString -> Text
- decodeUtf8With :: OnDecodeError -> ByteString -> Text
- decodeUtf16LEWith :: OnDecodeError -> ByteString -> Text
- decodeUtf16BEWith :: OnDecodeError -> ByteString -> Text
- decodeUtf32LEWith :: OnDecodeError -> ByteString -> Text
- decodeUtf32BEWith :: OnDecodeError -> ByteString -> Text
- encodeUtf8 :: Text -> ByteString
- encodeUtf16LE :: Text -> ByteString
- encodeUtf16BE :: Text -> ByteString
- encodeUtf32LE :: Text -> ByteString
- encodeUtf32BE :: Text -> ByteString
Decoding ByteStrings to Text
decodeASCII :: ByteString -> TextSource
Decode a ByteString
containing 7-bit ASCII encoded text.
decodeUtf8 :: ByteString -> TextSource
Decode a ByteString
containing UTF-8 encoded text.
decodeUtf16LE :: ByteString -> TextSource
Decode text from little endian UTF-16 encoding.
decodeUtf16BE :: ByteString -> TextSource
Decode text from big endian UTF-16 encoding.
decodeUtf32LE :: ByteString -> TextSource
Decode text from little endian UTF-32 encoding.
decodeUtf32BE :: ByteString -> TextSource
Decode text from big endian UTF-32 encoding.
Controllable error handling
decodeUtf8With :: OnDecodeError -> ByteString -> TextSource
Decode a ByteString
containing UTF-8 encoded text.
decodeUtf16LEWith :: OnDecodeError -> ByteString -> TextSource
Decode text from little endian UTF-16 encoding.
decodeUtf16BEWith :: OnDecodeError -> ByteString -> TextSource
Decode text from big endian UTF-16 encoding.
decodeUtf32LEWith :: OnDecodeError -> ByteString -> TextSource
Decode text from little endian UTF-32 encoding.
decodeUtf32BEWith :: OnDecodeError -> ByteString -> TextSource
Decode text from big endian UTF-32 encoding.
Encoding Text to ByteStrings
encodeUtf8 :: Text -> ByteStringSource
Encode text using UTF-8 encoding.
encodeUtf16LE :: Text -> ByteStringSource
Encode text using little endian UTF-16 encoding.
encodeUtf16BE :: Text -> ByteStringSource
Encode text using big endian UTF-16 encoding.
encodeUtf32LE :: Text -> ByteStringSource
Encode text using little endian UTF-32 encoding.
encodeUtf32BE :: Text -> ByteStringSource
Encode text using big endian UTF-32 encoding.