[GHC] #3307: System.IO and System.Directory functions not Unicode-aware under Unix

GHC trac at galois.com
Wed Jun 17 21:13:23 EDT 2009


#3307: System.IO and System.Directory functions not Unicode-aware under Unix
------------------------------+---------------------------------------------
Reporter:  YitzGale           |          Owner:                  
    Type:  bug                |         Status:  new             
Priority:  normal             |      Component:  libraries/base  
 Version:  6.11               |       Severity:  normal          
Keywords:  directory unicode  |       Testcase:                  
      Os:  Unknown/Multiple   |   Architecture:  Unknown/Multiple
------------------------------+---------------------------------------------
 Under Unix, file paths are represented as raw bytes in a String.
 That is not user-friendly, because a String is supposed to be
 decoded Unicode, and it is conventional in Unix to view those
 raw bytes as encoded according to the current locale. In addition,
 this is not consistent with Windows, where file paths are
 natively Unicode and represented as such in the String.
 (Well, they will be consistently once #3300 is completed.)

 On the other hand, this raises various complications (what about encoding
 errors, and what if encode.decode is not the identity due to
 normalisation, etc.)

 The following cases ought to work consistently for all file operations
 in System.IO and System.Directory:

  * A !FilePath from getArgs
  * A !FilePath from getDirectoryContents
  * A !FilePath in Unicode from a String literal,
  * A !FilePath read from a Handle and decoded into Unicode

 See discussion in the thread http://www.haskell.org/pipermail/haskell-
 cafe/2009-June/062795.html

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


More information about the Glasgow-haskell-bugs mailing list