Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- decodeUtf16LE :: ShortByteString -> String
- decodeUtf16LEWith :: OnDecodeError -> ShortByteString -> String
- decodeUtf16LE' :: ShortByteString -> Either UnicodeException String
- decodeUtf16LE'' :: ByteString -> Either UnicodeException String
- decodeUtf8 :: ShortByteString -> String
- decodeUtf8With :: OnDecodeError -> ShortByteString -> String
- decodeUtf8' :: ShortByteString -> Either UnicodeException String
- strictDecode :: OnDecodeError
- lenientDecode :: OnDecodeError
- type OnError a b = String -> Maybe a -> Maybe b
- type OnDecodeError = OnError Word8 Char
- data UnicodeException = DecodeError String (Maybe Word8)
Documentation
decodeUtf16LE :: ShortByteString -> String Source #
Decode text from little endian UTF-16 encoding.
If the input contains any invalid little endian UTF-16 data, an
exception will be thrown. For more control over the handling of
invalid data, use decodeUtf16LEWith
.
decodeUtf16LEWith :: OnDecodeError -> ShortByteString -> String Source #
Decode text from little endian UTF-16 encoding.
decodeUtf16LE' :: ShortByteString -> Either UnicodeException String Source #
Decode a ShortByteString
containing UTF-16 encoded text.
If the input contains any invalid UTF-16 data, the relevant exception will be returned, otherwise the decoded text.
decodeUtf16LE'' :: ByteString -> Either UnicodeException String Source #
Decode a ByteString
containing UTF-16 encoded text.
If the input contains any invalid UTF-16 data, the relevant exception will be returned, otherwise the decoded text.
decodeUtf8 :: ShortByteString -> String Source #
Decode text from little endian UTF-16 encoding.
If the input contains any invalid little endian UTF-16 data, an
exception will be thrown. For more control over the handling of
invalid data, use decodeUtf16LEWith
.
decodeUtf8With :: OnDecodeError -> ShortByteString -> String Source #
Decode text from little endian UTF-16 encoding.
decodeUtf8' :: ShortByteString -> Either UnicodeException String Source #
Decode a ShortByteString
containing UTF-8 encoded text.
If the input contains any invalid UTF-8 data, the relevant exception will be returned, otherwise the decoded text.
strictDecode :: OnDecodeError Source #
Throw a UnicodeException
if decoding fails.
lenientDecode :: OnDecodeError Source #
Replace an invalid input byte with the Unicode replacement character U+FFFD.
data UnicodeException Source #
An exception type for representing Unicode encoding errors.
DecodeError String (Maybe Word8) | Could not decode a byte sequence because it was invalid under the given encoding, or ran out of input in mid-decode. |
Instances
Eq UnicodeException Source # | |
Defined in System.AbstractFilePath.Data.ByteString.Short.Decode (==) :: UnicodeException -> UnicodeException -> Bool # (/=) :: UnicodeException -> UnicodeException -> Bool # | |
Show UnicodeException Source # | |
Defined in System.AbstractFilePath.Data.ByteString.Short.Decode showsPrec :: Int -> UnicodeException -> ShowS # show :: UnicodeException -> String # showList :: [UnicodeException] -> ShowS # | |
Exception UnicodeException Source # | |
NFData UnicodeException Source # | |
Defined in System.AbstractFilePath.Data.ByteString.Short.Decode rnf :: UnicodeException -> () # |