encoding-0.8.10: A library for various character encodings
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Encoding

Synopsis

Documentation

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

Encoding DynEncoding Source # 
Instance details

Defined in Data.Encoding.Base

Encoding BootString Source # 
Instance details

Defined in Data.Encoding.BootString

Encoding CP1250 Source # 
Instance details

Defined in Data.Encoding.CP1250

Encoding CP1251 Source # 
Instance details

Defined in Data.Encoding.CP1251

Encoding CP1252 Source # 
Instance details

Defined in Data.Encoding.CP1252

Encoding CP1253 Source # 
Instance details

Defined in Data.Encoding.CP1253

Encoding CP1254 Source # 
Instance details

Defined in Data.Encoding.CP1254

Encoding CP1255 Source # 
Instance details

Defined in Data.Encoding.CP1255

Encoding CP1256 Source # 
Instance details

Defined in Data.Encoding.CP1256

Encoding CP1257 Source # 
Instance details

Defined in Data.Encoding.CP1257

Encoding CP1258 Source # 
Instance details

Defined in Data.Encoding.CP1258

Encoding CP437 Source # 
Instance details

Defined in Data.Encoding.CP437

Encoding CP737 Source # 
Instance details

Defined in Data.Encoding.CP737

Encoding CP775 Source # 
Instance details

Defined in Data.Encoding.CP775

Encoding CP850 Source # 
Instance details

Defined in Data.Encoding.CP850

Encoding CP852 Source # 
Instance details

Defined in Data.Encoding.CP852

Encoding CP855 Source # 
Instance details

Defined in Data.Encoding.CP855

Encoding CP857 Source # 
Instance details

Defined in Data.Encoding.CP857

Encoding CP860 Source # 
Instance details

Defined in Data.Encoding.CP860

Encoding CP861 Source # 
Instance details

Defined in Data.Encoding.CP861

Encoding CP862 Source # 
Instance details

Defined in Data.Encoding.CP862

Encoding CP863 Source # 
Instance details

Defined in Data.Encoding.CP863

Encoding CP864 Source # 
Instance details

Defined in Data.Encoding.CP864

Encoding CP865 Source # 
Instance details

Defined in Data.Encoding.CP865

Encoding CP866 Source # 
Instance details

Defined in Data.Encoding.CP866

Encoding CP869 Source # 
Instance details

Defined in Data.Encoding.CP869

Encoding CP874 Source # 
Instance details

Defined in Data.Encoding.CP874

Encoding CP932 Source # 
Instance details

Defined in Data.Encoding.CP932

Encoding GB18030 Source # 
Instance details

Defined in Data.Encoding.GB18030

Encoding ISO2022JP Source # 
Instance details

Defined in Data.Encoding.ISO2022JP

Encoding ISO88591 Source # 
Instance details

Defined in Data.Encoding.ISO88591

Encoding ISO885910 Source # 
Instance details

Defined in Data.Encoding.ISO885910

Encoding ISO885911 Source # 
Instance details

Defined in Data.Encoding.ISO885911

Encoding ISO885913 Source # 
Instance details

Defined in Data.Encoding.ISO885913

Encoding ISO885914 Source # 
Instance details

Defined in Data.Encoding.ISO885914

Encoding ISO885915 Source # 
Instance details

Defined in Data.Encoding.ISO885915

Encoding ISO885916 Source # 
Instance details

Defined in Data.Encoding.ISO885916

Encoding ISO88592 Source # 
Instance details

Defined in Data.Encoding.ISO88592

Encoding ISO88593 Source # 
Instance details

Defined in Data.Encoding.ISO88593

Encoding ISO88594 Source # 
Instance details

Defined in Data.Encoding.ISO88594

Encoding ISO88595 Source # 
Instance details

Defined in Data.Encoding.ISO88595

Encoding ISO88596 Source # 
Instance details

Defined in Data.Encoding.ISO88596

Encoding ISO88597 Source # 
Instance details

Defined in Data.Encoding.ISO88597

Encoding ISO88598 Source # 
Instance details

Defined in Data.Encoding.ISO88598

Encoding ISO88599 Source # 
Instance details

Defined in Data.Encoding.ISO88599

Encoding JISX0201 Source # 
Instance details

Defined in Data.Encoding.JISX0201

Encoding JISX0208 Source # 
Instance details

Defined in Data.Encoding.JISX0208

Encoding JISX0212 Source # 
Instance details

Defined in Data.Encoding.JISX0212

Encoding KOI8R Source # 
Instance details

Defined in Data.Encoding.KOI8R

Encoding KOI8U Source # 
Instance details

Defined in Data.Encoding.KOI8U

Encoding MacOSRoman Source # 
Instance details

Defined in Data.Encoding.MacOSRoman

Encoding ShiftJIS Source # 
Instance details

Defined in Data.Encoding.ShiftJIS

Encoding UTF16 Source # 
Instance details

Defined in Data.Encoding.UTF16

Encoding UTF32 Source # 
Instance details

Defined in Data.Encoding.UTF32

Encoding UTF8 Source # 
Instance details

Defined in Data.Encoding.UTF8

data DynEncoding Source #

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

Instances

Instances details
Show DynEncoding Source # 
Instance details

Defined in Data.Encoding.Base

Encoding DynEncoding Source # 
Instance details

Defined in Data.Encoding.Base

Eq DynEncoding Source # 
Instance details

Defined in Data.Encoding.Base

recode :: (Encoding enc1, Encoding enc2, ByteSource m, ByteSink m) => enc1 -> enc2 -> m () 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