[GHC] #11096: Builtin encoder/decoder should be used for Latin-1

#11096: Builtin encoder/decoder should be used for Latin-1 -------------------------------------+------------------------------------- Reporter: bgamari | Owner: hvr Type: feature | Status: new request | Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.10.2 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Filed on behalf of hvr. Currently `mkTextEncoding'` delegates decoding/encoding from/to latin-1 to `iconv`. This shouldn't be necessary as we have latin-1 an encoder in `base`. Let's use it. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11096 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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: | -------------------------------------+------------------------------------- Description changed by bgamari: Old description:
Filed on behalf of hvr.
Currently `mkTextEncoding'` delegates decoding/encoding from/to latin-1 to `iconv`. This shouldn't be necessary as we have latin-1 an encoder in `base`. Let's use it.
New description: Filed on behalf of hvr. Currently `mkTextEncoding'` delegates decoding/encoding from/to latin-1 to `iconv`. This shouldn't be necessary as we have latin-1 an encoder in `base`. Let's use it like we do the built-in ASCII codec. -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11096#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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

#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 Herbert Valerio Riedel

#11096: Builtin encoder/decoder should be used for Latin-1 -------------------------------------+------------------------------------- Reporter: bgamari | Owner: hvr Type: feature request | Status: closed Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 7.10.2 Resolution: fixed | 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: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => closed * resolution: => fixed Comment: Ahh, this is actually fixed. Yay! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11096#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC