| Copyright | (c) Eric Mertens 2007 |
|---|---|
| License | BSD3-style (see LICENSE) |
| Maintainer | emertens@galois.com |
| Stability | experimental |
| Portability | portable |
| Safe Haskell | Trustworthy |
| Language | Haskell98 |
Codec.Binary.UTF8.String
Description
Support for encoding UTF8 Strings to and from [Word8]
Synopsis
- encode :: String -> [Word8]
- decode :: [Word8] -> String
- encodeString :: String -> String
- decodeString :: String -> String
- encodeChar :: Char -> [Word8]
- isUTF8Encoded :: String -> Bool
- utf8Encode :: String -> String
Documentation
Decode a UTF8 string packed into a list of Word8 values, directly to String
decodeString :: String -> String #
encodeChar :: Char -> [Word8] #
Encode a single Haskell Char to a list of Word8 values, in UTF8 format.
isUTF8Encoded :: String -> Bool #
isUTF8Encoded str tries to recognize input string as being in UTF-8 form.
utf8Encode :: String -> String #
utf8Encode str is a convenience function; checks to see if
str isn't UTF-8 encoded before doing so. Sometimes useful, but
you are better off keeping track of the encoding so as to avoid
the cost of checking.