darcs-2.18.2: a distributed, interactive, smart revision control system

Safe Haskell | None
Language | Haskell2010

Darcs.Util.Encoding

Synopsis

- encode :: String -> IO ByteString
- decode :: ByteString -> IO String
- encodeUtf8 :: String -> IO ByteString
- decodeUtf8 :: ByteString -> IO String

# Documentation

encode :: String -> IO ByteString #

Encode a `String` into a `ByteString` according to the user's locale with the ghc specific //ROUNDTRIP feature added. This means the argument is allowed to contain non-Unicode `Char`s as produced by `decode`.

decode :: ByteString -> IO String #

Decode a `ByteString` into a `String` according to the user's locale with the ghc specific //ROUNDTRIP feature added. This means the result may contain `Char`s that are not valid Unicode in case decoding with the user's locale fails.

encodeUtf8 :: String -> IO ByteString #

decodeUtf8 :: ByteString -> IO String #