System.IO and System.Directory functions not Unicode-aware under Unix
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 (closed) 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
Trac metadata
Trac field | Value |
---|---|
Version | 6.11 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | libraries/base |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |