#5061: Implement FFI spec behaviour for *CString family
---------------------------------+------------------------------------------
    Reporter:  batterseapower    |        Owner:              
        Type:  bug               |       Status:  patch       
    Priority:  normal            |    Milestone:              
   Component:  Compiler          |      Version:  7.0.3       
    Keywords:                    |     Testcase:              
   Blockedby:                    |   Difficulty:              
          Os:  Unknown/Multiple  |     Blocking:              
Architecture:  Unknown/Multiple  |      Failure:  None/Unknown
---------------------------------+------------------------------------------

Comment(by batterseapower):

 I see that this is a dup of #1414, so this issue has been around for a
 while.

 How about this for a plan:

  * Implement PEP 383 (surrogate byte encodings)

  * Use the locale encoding w/ PEP 383 behaviour for encoding/decoding
 stuff in withCString by default. This has the following knock-on effects:

   1. File names will be decoded using the current locale on all platforms,
 insofar as that is possible (#3307, maybe more)

   2. Command line arguments from getArgs will be decoded in the same
 manner (#3309, #3308)

   3. Command line arguments to spawned processes will be encoded with
 current locale (#4006), but the surrogate byte stuff means that filenames
 supplied in such a command line won't be mangled

 In the glorious future where everyones machines use UTF-8 locales and
 UTF-8 filenames everywhere, surrogate bytes will never appear and we will
 be able to turn off the surrogate bytes mechanism without anyone noticing,
 and all Strings will be decoded just as people expect.

 I can probably take the lead on implementing this if you think it is a
 good strategy.

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

_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to