encoding-0.10.2: A library for various character encodings

Safe Haskell | None
Language | Haskell2010

Data.Encoding

Synopsis

- module Data.Encoding.Exception
- module Data.Encoding.ByteSource
- module Data.Encoding.ByteSink
- class Encoding enc where
  - decodeChar :: ByteSource m => enc -> m Char
  - encodeChar :: ByteSink m => enc -> Char -> m ()
  - decode :: ByteSource m => enc -> m String
  - encode :: ByteSink m => enc -> String -> m ()
  - encodeable :: enc -> Char -> Bool
- data DynEncoding
- recode :: (Encoding enc1, Encoding enc2, ByteSource m, ByteSink m) => enc1 -> enc2 -> m ()
- encodeString :: Encoding enc => enc -> String -> String
- encodeStringExplicit :: Encoding enc => enc -> String -> Either EncodingException String
- decodeString :: Encoding enc => enc -> String -> String
- decodeStringExplicit :: Encoding enc => enc -> String -> Either DecodingException String
- encodeLazyByteString :: Encoding enc => enc -> String -> ByteString
- encodeLazyByteStringExplicit :: Encoding enc => enc -> String -> Either EncodingException ByteString
- decodeLazyByteString :: Encoding enc => enc -> ByteString -> String
- decodeLazyByteStringExplicit :: Encoding enc => enc -> ByteString -> Either DecodingException String
- encodeStrictByteString :: Encoding enc => enc -> String -> ByteString
- encodeStrictByteStringExplicit :: Encoding enc => enc -> String -> Either EncodingException ByteString
- decodeStrictByteString :: Encoding enc => enc -> ByteString -> String
- decodeStrictByteStringExplicit :: Encoding enc => enc -> ByteString -> Either DecodingException String
- encodingFromString :: String -> DynEncoding
- encodingFromStringExplicit :: String -> Maybe DynEncoding

# Documentation

module Data.Encoding.Exception

module Data.Encoding.ByteSource

module Data.Encoding.ByteSink

class Encoding enc where Source #

The base class for all encodings. At least decodeChar, encodeChar and encodeable must be implemented.

Minimal complete definition

decodeChar, encodeChar, encodeable

Methods

decodeChar :: ByteSource m => enc -> m Char Source #

Read a single character of a ByteSource

encodeChar :: ByteSink m => enc -> Char -> m () Source #

Encode a single character and write it to a ByteSink

decode :: ByteSource m => enc -> m String Source #

Read characters from a ByteSource until it is empty

encode :: ByteSink m => enc -> String -> m () Source #

Encode a String and write it to a ByteSink

encodeable :: enc -> Char -> Bool Source #

Tests whether a given character is representable in the Encoding. If this yields True, encodeChar must not fail. If it yields False, encodeChar _must_ throw an exception.

#### Instances

Instances details

Encoding ASCII Source # |
Instance details Defined in Data.Encoding.ASCII Methods decodeChar :: ByteSource m => ASCII -> m Char Source # encodeChar :: ByteSink m => ASCII -> Char -> m () Source # decode :: ByteSource m => ASCII -> m String Source # encode :: ByteSink m => ASCII -> String -> m () Source # encodeable :: ASCII -> Char -> Bool Source #
Encoding DynEncoding Source # |
Instance details Defined in Data.Encoding.Base Methods decodeChar :: ByteSource m => DynEncoding -> m Char Source # encodeChar :: ByteSink m => DynEncoding -> Char -> m () Source # decode :: ByteSource m => DynEncoding -> m String Source # encode :: ByteSink m => DynEncoding -> String -> m () Source # encodeable :: DynEncoding -> Char -> Bool Source #
Encoding BootString Source # |
Instance details Defined in Data.Encoding.BootString Methods decodeChar :: ByteSource m => BootString -> m Char Source # encodeChar :: ByteSink m => BootString -> Char -> m () Source # decode :: ByteSource m => BootString -> m String Source # encode :: ByteSink m => BootString -> String -> m () Source # encodeable :: BootString -> Char -> Bool Source #
Encoding CP1250 Source # |
Instance details Defined in Data.Encoding.CP1250 Methods decodeChar :: ByteSource m => CP1250 -> m Char Source # encodeChar :: ByteSink m => CP1250 -> Char -> m () Source # decode :: ByteSource m => CP1250 -> m String Source # encode :: ByteSink m => CP1250 -> String -> m () Source # encodeable :: CP1250 -> Char -> Bool Source #
Encoding CP1251 Source # |
Instance details Defined in Data.Encoding.CP1251 Methods decodeChar :: ByteSource m => CP1251 -> m Char Source # encodeChar :: ByteSink m => CP1251 -> Char -> m () Source # decode :: ByteSource m => CP1251 -> m String Source # encode :: ByteSink m => CP1251 -> String -> m () Source # encodeable :: CP1251 -> Char -> Bool Source #
Encoding CP1252 Source # |
Instance details Defined in Data.Encoding.CP1252 Methods decodeChar :: ByteSource m => CP1252 -> m Char Source # encodeChar :: ByteSink m => CP1252 -> Char -> m () Source # decode :: ByteSource m => CP1252 -> m String Source # encode :: ByteSink m => CP1252 -> String -> m () Source # encodeable :: CP1252 -> Char -> Bool Source #
Encoding CP1253 Source # |
Instance details Defined in Data.Encoding.CP1253 Methods decodeChar :: ByteSource m => CP1253 -> m Char Source # encodeChar :: ByteSink m => CP1253 -> Char -> m () Source # decode :: ByteSource m => CP1253 -> m String Source # encode :: ByteSink m => CP1253 -> String -> m () Source # encodeable :: CP1253 -> Char -> Bool Source #
Encoding CP1254 Source # |
Instance details Defined in Data.Encoding.CP1254 Methods decodeChar :: ByteSource m => CP1254 -> m Char Source # encodeChar :: ByteSink m => CP1254 -> Char -> m () Source # decode :: ByteSource m => CP1254 -> m String Source # encode :: ByteSink m => CP1254 -> String -> m () Source # encodeable :: CP1254 -> Char -> Bool Source #
Encoding CP1255 Source # |
Instance details Defined in Data.Encoding.CP1255 Methods decodeChar :: ByteSource m => CP1255 -> m Char Source # encodeChar :: ByteSink m => CP1255 -> Char -> m () Source # decode :: ByteSource m => CP1255 -> m String Source # encode :: ByteSink m => CP1255 -> String -> m () Source # encodeable :: CP1255 -> Char -> Bool Source #
Encoding CP1256 Source # |
Instance details Defined in Data.Encoding.CP1256 Methods decodeChar :: ByteSource m => CP1256 -> m Char Source # encodeChar :: ByteSink m => CP1256 -> Char -> m () Source # decode :: ByteSource m => CP1256 -> m String Source # encode :: ByteSink m => CP1256 -> String -> m () Source # encodeable :: CP1256 -> Char -> Bool Source #
Encoding CP1257 Source # |
Instance details Defined in Data.Encoding.CP1257 Methods decodeChar :: ByteSource m => CP1257 -> m Char Source # encodeChar :: ByteSink m => CP1257 -> Char -> m () Source # decode :: ByteSource m => CP1257 -> m String Source # encode :: ByteSink m => CP1257 -> String -> m () Source # encodeable :: CP1257 -> Char -> Bool Source #
Encoding CP1258 Source # |
Instance details Defined in Data.Encoding.CP1258 Methods decodeChar :: ByteSource m => CP1258 -> m Char Source # encodeChar :: ByteSink m => CP1258 -> Char -> m () Source # decode :: ByteSource m => CP1258 -> m String Source # encode :: ByteSink m => CP1258 -> String -> m () Source # encodeable :: CP1258 -> Char -> Bool Source #
Encoding CP437 Source # |
Instance details Defined in Data.Encoding.CP437 Methods decodeChar :: ByteSource m => CP437 -> m Char Source # encodeChar :: ByteSink m => CP437 -> Char -> m () Source # decode :: ByteSource m => CP437 -> m String Source # encode :: ByteSink m => CP437 -> String -> m () Source # encodeable :: CP437 -> Char -> Bool Source #
Encoding CP737 Source # |
Instance details Defined in Data.Encoding.CP737 Methods decodeChar :: ByteSource m => CP737 -> m Char Source # encodeChar :: ByteSink m => CP737 -> Char -> m () Source # decode :: ByteSource m => CP737 -> m String Source # encode :: ByteSink m => CP737 -> String -> m () Source # encodeable :: CP737 -> Char -> Bool Source #
Encoding CP775 Source # |
Instance details Defined in Data.Encoding.CP775 Methods decodeChar :: ByteSource m => CP775 -> m Char Source # encodeChar :: ByteSink m => CP775 -> Char -> m () Source # decode :: ByteSource m => CP775 -> m String Source # encode :: ByteSink m => CP775 -> String -> m () Source # encodeable :: CP775 -> Char -> Bool Source #
Encoding CP850 Source # |
Instance details Defined in Data.Encoding.CP850 Methods decodeChar :: ByteSource m => CP850 -> m Char Source # encodeChar :: ByteSink m => CP850 -> Char -> m () Source # decode :: ByteSource m => CP850 -> m String Source # encode :: ByteSink m => CP850 -> String -> m () Source # encodeable :: CP850 -> Char -> Bool Source #
Encoding CP852 Source # |
Instance details Defined in Data.Encoding.CP852 Methods decodeChar :: ByteSource m => CP852 -> m Char Source # encodeChar :: ByteSink m => CP852 -> Char -> m () Source # decode :: ByteSource m => CP852 -> m String Source # encode :: ByteSink m => CP852 -> String -> m () Source # encodeable :: CP852 -> Char -> Bool Source #
Encoding CP855 Source # |
Instance details Defined in Data.Encoding.CP855 Methods decodeChar :: ByteSource m => CP855 -> m Char Source # encodeChar :: ByteSink m => CP855 -> Char -> m () Source # decode :: ByteSource m => CP855 -> m String Source # encode :: ByteSink m => CP855 -> String -> m () Source # encodeable :: CP855 -> Char -> Bool Source #
Encoding CP857 Source # |
Instance details Defined in Data.Encoding.CP857 Methods decodeChar :: ByteSource m => CP857 -> m Char Source # encodeChar :: ByteSink m => CP857 -> Char -> m () Source # decode :: ByteSource m => CP857 -> m String Source # encode :: ByteSink m => CP857 -> String -> m () Source # encodeable :: CP857 -> Char -> Bool Source #
Encoding CP860 Source # |
Instance details Defined in Data.Encoding.CP860 Methods decodeChar :: ByteSource m => CP860 -> m Char Source # encodeChar :: ByteSink m => CP860 -> Char -> m () Source # decode :: ByteSource m => CP860 -> m String Source # encode :: ByteSink m => CP860 -> String -> m () Source # encodeable :: CP860 -> Char -> Bool Source #
Encoding CP861 Source # |
Instance details Defined in Data.Encoding.CP861 Methods decodeChar :: ByteSource m => CP861 -> m Char Source # encodeChar :: ByteSink m => CP861 -> Char -> m () Source # decode :: ByteSource m => CP861 -> m String Source # encode :: ByteSink m => CP861 -> String -> m () Source # encodeable :: CP861 -> Char -> Bool Source #
Encoding CP862 Source # |
Instance details Defined in Data.Encoding.CP862 Methods decodeChar :: ByteSource m => CP862 -> m Char Source # encodeChar :: ByteSink m => CP862 -> Char -> m () Source # decode :: ByteSource m => CP862 -> m String Source # encode :: ByteSink m => CP862 -> String -> m () Source # encodeable :: CP862 -> Char -> Bool Source #
Encoding CP863 Source # |
Instance details Defined in Data.Encoding.CP863 Methods decodeChar :: ByteSource m => CP863 -> m Char Source # encodeChar :: ByteSink m => CP863 -> Char -> m () Source # decode :: ByteSource m => CP863 -> m String Source # encode :: ByteSink m => CP863 -> String -> m () Source # encodeable :: CP863 -> Char -> Bool Source #
Encoding CP864 Source # |
Instance details Defined in Data.Encoding.CP864 Methods decodeChar :: ByteSource m => CP864 -> m Char Source # encodeChar :: ByteSink m => CP864 -> Char -> m () Source # decode :: ByteSource m => CP864 -> m String Source # encode :: ByteSink m => CP864 -> String -> m () Source # encodeable :: CP864 -> Char -> Bool Source #
Encoding CP865 Source # |
Instance details Defined in Data.Encoding.CP865 Methods decodeChar :: ByteSource m => CP865 -> m Char Source # encodeChar :: ByteSink m => CP865 -> Char -> m () Source # decode :: ByteSource m => CP865 -> m String Source # encode :: ByteSink m => CP865 -> String -> m () Source # encodeable :: CP865 -> Char -> Bool Source #
Encoding CP866 Source # |
Instance details Defined in Data.Encoding.CP866 Methods decodeChar :: ByteSource m => CP866 -> m Char Source # encodeChar :: ByteSink m => CP866 -> Char -> m () Source # decode :: ByteSource m => CP866 -> m String Source # encode :: ByteSink m => CP866 -> String -> m () Source # encodeable :: CP866 -> Char -> Bool Source #
Encoding CP869 Source # |
Instance details Defined in Data.Encoding.CP869 Methods decodeChar :: ByteSource m => CP869 -> m Char Source # encodeChar :: ByteSink m => CP869 -> Char -> m () Source # decode :: ByteSource m => CP869 -> m String Source # encode :: ByteSink m => CP869 -> String -> m () Source # encodeable :: CP869 -> Char -> Bool Source #
Encoding CP874 Source # |
Instance details Defined in Data.Encoding.CP874 Methods decodeChar :: ByteSource m => CP874 -> m Char Source # encodeChar :: ByteSink m => CP874 -> Char -> m () Source # decode :: ByteSource m => CP874 -> m String Source # encode :: ByteSink m => CP874 -> String -> m () Source # encodeable :: CP874 -> Char -> Bool Source #
Encoding CP932 Source # |
Instance details Defined in Data.Encoding.CP932 Methods decodeChar :: ByteSource m => CP932 -> m Char Source # encodeChar :: ByteSink m => CP932 -> Char -> m () Source # decode :: ByteSource m => CP932 -> m String Source # encode :: ByteSink m => CP932 -> String -> m () Source # encodeable :: CP932 -> Char -> Bool Source #
Encoding GB18030 Source # |
Instance details Defined in Data.Encoding.GB18030 Methods decodeChar :: ByteSource m => GB18030 -> m Char Source # encodeChar :: ByteSink m => GB18030 -> Char -> m () Source # decode :: ByteSource m => GB18030 -> m String Source # encode :: ByteSink m => GB18030 -> String -> m () Source # encodeable :: GB18030 -> Char -> Bool Source #
Encoding ISO2022JP Source # |
Instance details Defined in Data.Encoding.ISO2022JP Methods decodeChar :: ByteSource m => ISO2022JP -> m Char Source # encodeChar :: ByteSink m => ISO2022JP -> Char -> m () Source # decode :: ByteSource m => ISO2022JP -> m String Source # encode :: ByteSink m => ISO2022JP -> String -> m () Source # encodeable :: ISO2022JP -> Char -> Bool Source #
Encoding ISO88591 Source # |
Instance details Defined in Data.Encoding.ISO88591 Methods decodeChar :: ByteSource m => ISO88591 -> m Char Source # encodeChar :: ByteSink m => ISO88591 -> Char -> m () Source # decode :: ByteSource m => ISO88591 -> m String Source # encode :: ByteSink m => ISO88591 -> String -> m () Source # encodeable :: ISO88591 -> Char -> Bool Source #
Encoding ISO885910 Source # |
Instance details Defined in Data.Encoding.ISO885910 Methods decodeChar :: ByteSource m => ISO885910 -> m Char Source # encodeChar :: ByteSink m => ISO885910 -> Char -> m () Source # decode :: ByteSource m => ISO885910 -> m String Source # encode :: ByteSink m => ISO885910 -> String -> m () Source # encodeable :: ISO885910 -> Char -> Bool Source #
Encoding ISO885911 Source # |
Instance details Defined in Data.Encoding.ISO885911 Methods decodeChar :: ByteSource m => ISO885911 -> m Char Source # encodeChar :: ByteSink m => ISO885911 -> Char -> m () Source # decode :: ByteSource m => ISO885911 -> m String Source # encode :: ByteSink m => ISO885911 -> String -> m () Source # encodeable :: ISO885911 -> Char -> Bool Source #
Encoding ISO885913 Source # |
Instance details Defined in Data.Encoding.ISO885913 Methods decodeChar :: ByteSource m => ISO885913 -> m Char Source # encodeChar :: ByteSink m => ISO885913 -> Char -> m () Source # decode :: ByteSource m => ISO885913 -> m String Source # encode :: ByteSink m => ISO885913 -> String -> m () Source # encodeable :: ISO885913 -> Char -> Bool Source #
Encoding ISO885914 Source # |
Instance details Defined in Data.Encoding.ISO885914 Methods decodeChar :: ByteSource m => ISO885914 -> m Char Source # encodeChar :: ByteSink m => ISO885914 -> Char -> m () Source # decode :: ByteSource m => ISO885914 -> m String Source # encode :: ByteSink m => ISO885914 -> String -> m () Source # encodeable :: ISO885914 -> Char -> Bool Source #
Encoding ISO885915 Source # |
Instance details Defined in Data.Encoding.ISO885915 Methods decodeChar :: ByteSource m => ISO885915 -> m Char Source # encodeChar :: ByteSink m => ISO885915 -> Char -> m () Source # decode :: ByteSource m => ISO885915 -> m String Source # encode :: ByteSink m => ISO885915 -> String -> m () Source # encodeable :: ISO885915 -> Char -> Bool Source #
Encoding ISO885916 Source # |
Instance details Defined in Data.Encoding.ISO885916 Methods decodeChar :: ByteSource m => ISO885916 -> m Char Source # encodeChar :: ByteSink m => ISO885916 -> Char -> m () Source # decode :: ByteSource m => ISO885916 -> m String Source # encode :: ByteSink m => ISO885916 -> String -> m () Source # encodeable :: ISO885916 -> Char -> Bool Source #
Encoding ISO88592 Source # |
Instance details Defined in Data.Encoding.ISO88592 Methods decodeChar :: ByteSource m => ISO88592 -> m Char Source # encodeChar :: ByteSink m => ISO88592 -> Char -> m () Source # decode :: ByteSource m => ISO88592 -> m String Source # encode :: ByteSink m => ISO88592 -> String -> m () Source # encodeable :: ISO88592 -> Char -> Bool Source #
Encoding ISO88593 Source # |
Instance details Defined in Data.Encoding.ISO88593 Methods decodeChar :: ByteSource m => ISO88593 -> m Char Source # encodeChar :: ByteSink m => ISO88593 -> Char -> m () Source # decode :: ByteSource m => ISO88593 -> m String Source # encode :: ByteSink m => ISO88593 -> String -> m () Source # encodeable :: ISO88593 -> Char -> Bool Source #
Encoding ISO88594 Source # |
Instance details Defined in Data.Encoding.ISO88594 Methods decodeChar :: ByteSource m => ISO88594 -> m Char Source # encodeChar :: ByteSink m => ISO88594 -> Char -> m () Source # decode :: ByteSource m => ISO88594 -> m String Source # encode :: ByteSink m => ISO88594 -> String -> m () Source # encodeable :: ISO88594 -> Char -> Bool Source #
Encoding ISO88595 Source # |
Instance details Defined in Data.Encoding.ISO88595 Methods decodeChar :: ByteSource m => ISO88595 -> m Char Source # encodeChar :: ByteSink m => ISO88595 -> Char -> m () Source # decode :: ByteSource m => ISO88595 -> m String Source # encode :: ByteSink m => ISO88595 -> String -> m () Source # encodeable :: ISO88595 -> Char -> Bool Source #
Encoding ISO88596 Source # |
Instance details Defined in Data.Encoding.ISO88596 Methods decodeChar :: ByteSource m => ISO88596 -> m Char Source # encodeChar :: ByteSink m => ISO88596 -> Char -> m () Source # decode :: ByteSource m => ISO88596 -> m String Source # encode :: ByteSink m => ISO88596 -> String -> m () Source # encodeable :: ISO88596 -> Char -> Bool Source #
Encoding ISO88597 Source # |
Instance details Defined in Data.Encoding.ISO88597 Methods decodeChar :: ByteSource m => ISO88597 -> m Char Source # encodeChar :: ByteSink m => ISO88597 -> Char -> m () Source # decode :: ByteSource m => ISO88597 -> m String Source # encode :: ByteSink m => ISO88597 -> String -> m () Source # encodeable :: ISO88597 -> Char -> Bool Source #
Encoding ISO88598 Source # |
Instance details Defined in Data.Encoding.ISO88598 Methods decodeChar :: ByteSource m => ISO88598 -> m Char Source # encodeChar :: ByteSink m => ISO88598 -> Char -> m () Source # decode :: ByteSource m => ISO88598 -> m String Source # encode :: ByteSink m => ISO88598 -> String -> m () Source # encodeable :: ISO88598 -> Char -> Bool Source #
Encoding ISO88599 Source # |
Instance details Defined in Data.Encoding.ISO88599 Methods decodeChar :: ByteSource m => ISO88599 -> m Char Source # encodeChar :: ByteSink m => ISO88599 -> Char -> m () Source # decode :: ByteSource m => ISO88599 -> m String Source # encode :: ByteSink m => ISO88599 -> String -> m () Source # encodeable :: ISO88599 -> Char -> Bool Source #
Encoding JISX0201 Source # |
Instance details Defined in Data.Encoding.JISX0201 Methods decodeChar :: ByteSource m => JISX0201 -> m Char Source # encodeChar :: ByteSink m => JISX0201 -> Char -> m () Source # decode :: ByteSource m => JISX0201 -> m String Source # encode :: ByteSink m => JISX0201 -> String -> m () Source # encodeable :: JISX0201 -> Char -> Bool Source #
Encoding JISX0208 Source # |
Instance details Defined in Data.Encoding.JISX0208 Methods decodeChar :: ByteSource m => JISX0208 -> m Char Source # encodeChar :: ByteSink m => JISX0208 -> Char -> m () Source # decode :: ByteSource m => JISX0208 -> m String Source # encode :: ByteSink m => JISX0208 -> String -> m () Source # encodeable :: JISX0208 -> Char -> Bool Source #
Encoding JISX0212 Source # |
Instance details Defined in Data.Encoding.JISX0212 Methods decodeChar :: ByteSource m => JISX0212 -> m Char Source # encodeChar :: ByteSink m => JISX0212 -> Char -> m () Source # decode :: ByteSource m => JISX0212 -> m String Source # encode :: ByteSink m => JISX0212 -> String -> m () Source # encodeable :: JISX0212 -> Char -> Bool Source #
Encoding KOI8R Source # |
Instance details Defined in Data.Encoding.KOI8R Methods decodeChar :: ByteSource m => KOI8R -> m Char Source # encodeChar :: ByteSink m => KOI8R -> Char -> m () Source # decode :: ByteSource m => KOI8R -> m String Source # encode :: ByteSink m => KOI8R -> String -> m () Source # encodeable :: KOI8R -> Char -> Bool Source #
Encoding KOI8U Source # |
Instance details Defined in Data.Encoding.KOI8U Methods decodeChar :: ByteSource m => KOI8U -> m Char Source # encodeChar :: ByteSink m => KOI8U -> Char -> m () Source # decode :: ByteSource m => KOI8U -> m String Source # encode :: ByteSink m => KOI8U -> String -> m () Source # encodeable :: KOI8U -> Char -> Bool Source #
Encoding MacOSRoman Source # |
Instance details Defined in Data.Encoding.MacOSRoman Methods decodeChar :: ByteSource m => MacOSRoman -> m Char Source # encodeChar :: ByteSink m => MacOSRoman -> Char -> m () Source # decode :: ByteSource m => MacOSRoman -> m String Source # encode :: ByteSink m => MacOSRoman -> String -> m () Source # encodeable :: MacOSRoman -> Char -> Bool Source #
Encoding ShiftJIS Source # |
Instance details Defined in Data.Encoding.ShiftJIS Methods decodeChar :: ByteSource m => ShiftJIS -> m Char Source # encodeChar :: ByteSink m => ShiftJIS -> Char -> m () Source # decode :: ByteSource m => ShiftJIS -> m String Source # encode :: ByteSink m => ShiftJIS -> String -> m () Source # encodeable :: ShiftJIS -> Char -> Bool Source #
Encoding UTF16 Source # |
Instance details Defined in Data.Encoding.UTF16 Methods decodeChar :: ByteSource m => UTF16 -> m Char Source # encodeChar :: ByteSink m => UTF16 -> Char -> m () Source # decode :: ByteSource m => UTF16 -> m String Source # encode :: ByteSink m => UTF16 -> String -> m () Source # encodeable :: UTF16 -> Char -> Bool Source #
Encoding UTF32 Source # |
Instance details Defined in Data.Encoding.UTF32 Methods decodeChar :: ByteSource m => UTF32 -> m Char Source # encodeChar :: ByteSink m => UTF32 -> Char -> m () Source # decode :: ByteSource m => UTF32 -> m String Source # encode :: ByteSink m => UTF32 -> String -> m () Source # encodeable :: UTF32 -> Char -> Bool Source #
Encoding UTF8 Source # |
Instance details Defined in Data.Encoding.UTF8 Methods decodeChar :: ByteSource m => UTF8 -> m Char Source # encodeChar :: ByteSink m => UTF8 -> Char -> m () Source # decode :: ByteSource m => UTF8 -> m String Source # encode :: ByteSink m => UTF8 -> String -> m () Source # encodeable :: UTF8 -> Char -> Bool Source #

data DynEncoding Source #

Wraps all possible encoding types into one data type. Used when a function needs to return an encoding.

#### Instances

Instances details

Encoding DynEncoding Source # |
Instance details Defined in Data.Encoding.Base Methods decodeChar :: ByteSource m => DynEncoding -> m Char Source # encodeChar :: ByteSink m => DynEncoding -> Char -> m () Source # decode :: ByteSource m => DynEncoding -> m String Source # encode :: ByteSink m => DynEncoding -> String -> m () Source # encodeable :: DynEncoding -> Char -> Bool Source #
Show DynEncoding Source # |
Instance details Defined in Data.Encoding.Base Methods showsPrec :: Int -> DynEncoding -> ShowS Source # show :: DynEncoding -> String Source # showList :: [DynEncoding] -> ShowS Source #
Eq DynEncoding Source # |
Instance details Defined in Data.Encoding.Base Methods (==) :: DynEncoding -> DynEncoding -> Bool Source # (/=) :: DynEncoding -> DynEncoding -> Bool Source #

recode :: (Encoding enc1, Encoding enc2, ByteSource m, ByteSink m) => enc1 -> enc2 -> m () Source #

encodeString :: Encoding enc => enc -> String -> String Source #

encodeStringExplicit :: Encoding enc => enc -> String -> Either EncodingException String Source #

decodeString :: Encoding enc => enc -> String -> String Source #

decodeStringExplicit :: Encoding enc => enc -> String -> Either DecodingException String Source #

encodeLazyByteString :: Encoding enc => enc -> String -> ByteString Source #

encodeLazyByteStringExplicit :: Encoding enc => enc -> String -> Either EncodingException ByteString Source #

decodeLazyByteString :: Encoding enc => enc -> ByteString -> String Source #

decodeLazyByteStringExplicit :: Encoding enc => enc -> ByteString -> Either DecodingException String Source #

encodeStrictByteString :: Encoding enc => enc -> String -> ByteString Source #

encodeStrictByteStringExplicit :: Encoding enc => enc -> String -> Either EncodingException ByteString Source #

decodeStrictByteString :: Encoding enc => enc -> ByteString -> String Source #

decodeStrictByteStringExplicit :: Encoding enc => enc -> ByteString -> Either DecodingException String Source #

encodingFromString :: String -> DynEncoding Source #

Takes the name of an encoding and creates a dynamic encoding from it.

encodingFromStringExplicit :: String -> Maybe DynEncoding Source #

Like `encodingFromString` but returns `Nothing` instead of throwing an error