[commit: ghc] master: Fix naming of the native latin1 encodings (747e77c)

git at git.haskell.org git at git.haskell.org
Thu Dec 1 23:34:22 UTC 2016


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/747e77c9968ab09e11e78fe028bea8e1e3e97a48/ghc

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

commit 747e77c9968ab09e11e78fe028bea8e1e3e97a48
Author: Kai Ruemmler <kai.ruemmler at gmx.net>
Date:   Thu Dec 1 17:59:50 2016 -0500

    Fix naming of the native latin1 encodings
    
    textEncodingName is notjust a string, it must be a valid input for
    mkTextEncoding, as stated in libraries/base/GHC/IO/Encoding/Types.hs.
    
    Test Plan:
    A working latin1 locale is required on the system.  Reason: ghc's
    initial locale encoding defaults to ASCII, if either an unknown locale
    or unknown charset is used.  For the bug to show up, ghc must start up
    using the latin1 encoding.
    
    From main directory in ghc do:
    $ ./configure && make clean && make boot && make inplace/bin/ghc-stage2
    $ LC_CTYPE="de_DE.ISO-8859-1" ./inplace/bin/ghc-stage2
    
    Before the patch, the last line leads to the exception thrown:
    ghc-stage2: mkTextEncoding: does not exist (unknown
    encoding:ISO8859-1(checked)//TRANSLIT)
    
    After the patch, ghc-stage2 prints a short usage summary as expected.
    Moreover,
    $ make test TEST=encoding005
    continues to  pass after the patch.
    
    Reviewers: austin, hvr, rwbarton, bgamari
    
    Reviewed By: bgamari
    
    Subscribers: mpickering, rwbarton, thomie
    
    Differential Revision: https://phabricator.haskell.org/D2667


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

747e77c9968ab09e11e78fe028bea8e1e3e97a48
 libraries/base/GHC/IO/Encoding/Latin1.hs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libraries/base/GHC/IO/Encoding/Latin1.hs b/libraries/base/GHC/IO/Encoding/Latin1.hs
index efef240..730379e 100644
--- a/libraries/base/GHC/IO/Encoding/Latin1.hs
+++ b/libraries/base/GHC/IO/Encoding/Latin1.hs
@@ -50,7 +50,7 @@ latin1 = mkLatin1 ErrorOnCodingFailure
 
 -- | @since 4.4.0.0
 mkLatin1 :: CodingFailureMode -> TextEncoding
-mkLatin1 cfm = TextEncoding { textEncodingName = "ISO8859-1",
+mkLatin1 cfm = TextEncoding { textEncodingName = "ISO-8859-1",
                               mkTextDecoder = latin1_DF cfm,
                               mkTextEncoder = latin1_EF cfm }
 
@@ -79,7 +79,7 @@ latin1_checked = mkLatin1_checked ErrorOnCodingFailure
 
 -- | @since 4.4.0.0
 mkLatin1_checked :: CodingFailureMode -> TextEncoding
-mkLatin1_checked cfm = TextEncoding { textEncodingName = "ISO8859-1(checked)",
+mkLatin1_checked cfm = TextEncoding { textEncodingName = "ISO-8859-1",
                                       mkTextDecoder = latin1_DF cfm,
                                       mkTextEncoder = latin1_checked_EF cfm }
 



More information about the ghc-commits mailing list