| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Network.URI.Encode
Description
Unicode aware URI encoding and decoding functions for both String and Text. Although standards are pretty vague about Unicode in URIs most browsers are pretty straightforward when encoding URIs: Encode a text to a UTF-8 string and URI-encode every individual byte (not character).
Synopsis
- encode :: String -> String
- encodeWith :: (Char -> Bool) -> String -> String
- encodeText :: Text -> Text
- encodeTextWith :: (Char -> Bool) -> Text -> Text
- encodeTextToBS :: Text -> ByteString
- encodeTextToBSWith :: (Char -> Bool) -> Text -> ByteString
- encodeByteString :: ByteString -> ByteString
- encodeByteStringWith :: (Char -> Bool) -> ByteString -> ByteString
- decode :: String -> String
- decodeText :: Text -> Text
- decodeBSToText :: ByteString -> Text
- decodeByteString :: ByteString -> ByteString
- isAllowed :: Char -> Bool
Documentation
encodeText :: Text -> Text #
URI encode a Text, unicode aware.
encodeTextToBS :: Text -> ByteString #
URI encode a Text into a ByteString, unicode aware.
encodeTextToBSWith :: (Char -> Bool) -> Text -> ByteString #
encodeByteString :: ByteString -> ByteString #
URI encode a UTF8-encoded ByteString into a ByteString, unicode aware.
encodeByteStringWith :: (Char -> Bool) -> ByteString -> ByteString #
URI encode a UTF8-encoded 'ByteString into a ByteString, unicode aware,
using the predicate to decide which characters are escaped (False means
escape).
decodeText :: Text -> Text #
URI decode a Text, unicode aware.
decodeBSToText :: ByteString -> Text #
URI decode a ByteString into a Text, unicode aware.
decodeByteString :: ByteString -> ByteString #
URI decode a ByteString into a UTF8-encoded ByteString, unicode aware.