From: Simon Marlow Date: Wed, 15 Jul 2009 12:24:14 +0000 (+0000) Subject: Add more documentation to mkTextEncoding X-Git-Tag: ghc-darcs-git-switchover~350 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=609efe0b2f279af4616b2881b51212a8af94e3f1;p=ghc-base.git Add more documentation to mkTextEncoding noting that "//IGNORE" and "//TRANSLIT" suffixes can be used with GNU iconv. --- diff --git a/GHC/IO/Encoding.hs b/GHC/IO/Encoding.hs index a1da1b1..7763ce4 100644 --- a/GHC/IO/Encoding.hs +++ b/GHC/IO/Encoding.hs @@ -103,7 +103,24 @@ localeEncoding = Latin1.latin1 -- -- * 'isDoesNotExistError' if the encoding is unknown -- --- The set of known encodings is system-dependent. +-- The set of known encodings is system-dependent, but includes at least: +-- +-- * @UTF-8@ +-- +-- * @UTF-16@, @UTF-16BE@, @UTF-16LE@ +-- +-- * @UTF-32@, @UTF-32BE@, @UTF-32LE@ +-- +-- On systems using GNU iconv (e.g. Linux), there is additional +-- notation for specifying how illegal characters are handled: +-- +-- * a suffix of @\/\/IGNORE@, e.g. @UTF-8\/\/IGNORE@, will cause +-- all illegal sequences on input to be ignored, and on output +-- will drop all code points that have no representation in the +-- target encoding. +-- +-- * a suffix of @\/\/TRANSLIT@ will choose a replacement character +-- for illegal sequences or code points. -- mkTextEncoding :: String -> IO TextEncoding #if !defined(mingw32_HOST_OS)