[GHC] #10623: Handling of ASCII encodings introduced in D898 breaks Unicode terminal detection

GHC ghc-devs at haskell.org
Tue Jul 21 19:42:09 UTC 2015


#10623: Handling of ASCII encodings introduced in D898 breaks Unicode terminal
detection
-------------------------------------+-------------------------------------
        Reporter:  bgamari           |                   Owner:
            Type:  bug               |                  Status:  new
        Priority:  high              |               Milestone:  7.10.2
       Component:  Compiler          |                 Version:  7.10.2-rc2
      Resolution:                    |                Keywords:
Operating System:  Unknown/Multiple  |            Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |               Test Case:  T8958a
      Blocked By:                    |                Blocking:
 Related Tickets:  #10298, #7695     |  Differential Revisions:
                                     |  Phab:D1059, Phab:D1085
-------------------------------------+-------------------------------------

Comment (by Ben Gamari <ben@…>):

 In [changeset:"dbe6dac96543f426297a59d8d16c3f5afacf42d4/ghc" dbe6dac/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="dbe6dac96543f426297a59d8d16c3f5afacf42d4"
 When iconv is unavailable, use an ASCII encoding to encode ASCII

 D898 and D1059 implemented a fallback behavior to handle the case
 that the end user's iconv installation is broken (typically due to
 running inside a chroot in which the necessary locale files and/or
 gconv modules have not been installed). In this case, if the
 program requests an ASCII locale, GHC's char8 encoding is used
 rather than the program failing.

 However, silently mangling data like char8 does when the programmer
 did not ask for it is poor behavior, for reasons described in D1059.

 This commit implements an ASCII encoding and uses it in the fallback
 case when iconv is unavailable and the user has requested ASCII.

 Test Plan:
 Added tests for the encodings defined in Latin1.
 Also, manually ran a statically-linked executable of that test
 in a chroot and the tests passed (up to the ones that call
 mkTextEncoding "LATIN1", since there is no fallback from iconv
 for that case yet).

 Reviewers: austin, hvr, hsyl20, bgamari

 Reviewed By: hsyl20, bgamari

 Subscribers: thomie

 Differential Revision: https://phabricator.haskell.org/D1085

 GHC Trac Issues: #7695, #10623
 }}}

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10623#comment:6>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list