[GHC] #11096: Builtin encoder/decoder should be used for Latin-1
GHC
ghc-devs at haskell.org
Sun Nov 15 21:12:25 UTC 2015
#11096: Builtin encoder/decoder should be used for Latin-1
-------------------------------------+-------------------------------------
Reporter: bgamari | Owner: hvr
Type: feature request | Status: new
Priority: normal | Milestone: 8.0.1
Component: Compiler | Version: 7.10.2
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by hvr):
Here's a strawman-patch I'm using locally for the AIX port I'm working on:
{{{#!diff
--- a/libraries/base/GHC/IO/Encoding.hs
+++ b/libraries/base/GHC/IO/Encoding.hs
@@ -237,6 +237,8 @@ mkTextEncoding e = case mb_coding_failure_mode of
mkTextEncoding' :: CodingFailureMode -> String -> IO TextEncoding
mkTextEncoding' cfm enc =
case [toUpper c | c <- enc, c /= '-'] of
+ -- ISO8859-1 we can handle ourself
+ "ISO88591" -> return $ Latin1.mkLatin1 cfm
-- UTF-8 and friends we can handle ourselves
"UTF8" -> return $ UTF8.mkUTF8 cfm
"UTF16" -> return $ UTF16.mkUTF16 cfm
}}}
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11096#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list