Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Handles server-specified text decoding.
Synopsis
- resolveCharset :: [String] -> ByteString -> (String, Either Text ByteString)
- resolveCharset' :: a -> [String] -> ByteString -> (a, String, Either Text ByteString)
- convertCharset :: [Char] -> ByteString -> Text
- charsets :: [Text]
Documentation
:: [String] | The MIMEtype, split by ';' |
-> ByteString | The bytes received from the server |
-> (String, Either Text ByteString) | The MIMEtype (minus parameters) & possibly decoded text, to be returned from protocol handlers. |
If the MIMEtype specifies a charset parameter, apply it.
resolveCharset' :: a -> [String] -> ByteString -> (a, String, Either Text ByteString) Source #
As per resolveCharset
, but also returns given URI (or other type).
convertCharset :: [Char] -> ByteString -> Text Source #
Decodes bytes according to a charset identified by it's IANA-assigned name(s).