From 609efe0b2f279af4616b2881b51212a8af94e3f1 Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Wed, 15 Jul 2009 12:24:14 +0000 Subject: [PATCH] Add more documentation to mkTextEncoding noting that "//IGNORE" and "//TRANSLIT" suffixes can be used with GNU iconv. --- GHC/IO/Encoding.hs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) 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) -- 1.7.10.4