[commit: ghc] master: Use builtin ISO 8859-1 decoder in mkTextEncoding (36a208f)

git at git.haskell.org git at git.haskell.org
Fri Dec 4 11:48:52 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/36a208f44df4b3c1480e4b873efca75f6adae3b4/ghc

>---------------------------------------------------------------

commit 36a208f44df4b3c1480e4b873efca75f6adae3b4
Author: Herbert Valerio Riedel <hvr at gnu.org>
Date:   Fri Dec 4 12:15:23 2015 +0100

    Use builtin ISO 8859-1 decoder in mkTextEncoding
    
    We already do this for UTF8/16/32, so it seems obvious do the same
    for the closely related popular ISO 8859-1 encoding, and avoid iconv
    issues on some platforms (such as AIX which which bundles a broken
    `libiconv` by default)
    
    This fixes #11096


>---------------------------------------------------------------

36a208f44df4b3c1480e4b873efca75f6adae3b4
 libraries/base/GHC/IO/Encoding.hs | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libraries/base/GHC/IO/Encoding.hs b/libraries/base/GHC/IO/Encoding.hs
index a690717..18b5432 100644
--- a/libraries/base/GHC/IO/Encoding.hs
+++ b/libraries/base/GHC/IO/Encoding.hs
@@ -245,6 +245,8 @@ mkTextEncoding' cfm enc =
     "UTF32"   -> return $ UTF32.mkUTF32 cfm
     "UTF32LE" -> return $ UTF32.mkUTF32le cfm
     "UTF32BE" -> return $ UTF32.mkUTF32be cfm
+  -- ISO8859-1 we can handle ourselves as well
+    "ISO88591" -> return $ Latin1.mkLatin1 cfm
 #if defined(mingw32_HOST_OS)
     'C':'P':n | [(cp,"")] <- reads n -> return $ CodePage.mkCodePageEncoding cfm cp
     _ -> unknownEncodingErr (enc ++ codingFailureModeSuffix cfm)



More information about the ghc-commits mailing list