Portability | GHC-only |
---|---|
Stability | experimental |
Maintainer | kudahkukarek@gmail.com |
Safe Haskell | Trustworthy |
This module provides functions to encode and decode Text
to/from
ByteString
using TextEncoding
For performance, Text's native decode* functions are used if the conditions are right (LF NewlineMode and UTF encoding).
- decodeLocale :: ByteString -> IO Text
- encodeLocale :: Text -> IO ByteString
- decodeLocale' :: TextEncoding -> NewlineMode -> ByteString -> IO Text
- encodeLocale' :: TextEncoding -> NewlineMode -> Text -> IO ByteString
- decodeFromHandle :: Handle -> ByteString -> IO Text
- encodeFromHandle :: Handle -> Text -> IO ByteString
Documentation
decodeLocale :: ByteString -> IO TextSource
Decode ByteString
to Text
using current locale
encodeLocale :: Text -> IO ByteStringSource
Encode Text
to ByteString
using current locale
decodeLocale' :: TextEncoding -> NewlineMode -> ByteString -> IO TextSource
Decode ByteString
to Text
using supplied TextEncoding
and NewlineMode
encodeLocale' :: TextEncoding -> NewlineMode -> Text -> IO ByteStringSource
Encode Text
to ByteString
using supplied TextEncoding
and NewlineMode
decodeFromHandle :: Handle -> ByteString -> IO TextSource
Decode ByteString
to Text
using Handle
s TextEncoding
and NewlineMode
encodeFromHandle :: Handle -> Text -> IO ByteStringSource
Encode Text
to ByteString
using Handle
s TextEncoding
and NewlineMode