#3307: System.IO and System.Directory functions not Unicode-aware under Unix
----------------------------------+-----------------------------------------
    Reporter:  YitzGale           |        Owner:              
        Type:  bug                |       Status:  new         
    Priority:  normal             |    Milestone:  7.2.1       
   Component:  libraries/base     |      Version:  6.11        
    Keywords:  directory unicode  |     Testcase:              
   Blockedby:                     |   Difficulty:  Unknown     
          Os:  Unknown/Multiple   |     Blocking:              
Architecture:  Unknown/Multiple   |      Failure:  None/Unknown
----------------------------------+-----------------------------------------

Comment(by tsuyoshi):

 Replying to [comment:8 batterseapower]:
 >   3. Type "./bytes zw?A?n". Use literal question marks. This is where it
 gets really weird. The output is *exactly the same as before*. Bash has
 somehow detected that I "meant" to refer to the file in the current
 working directory and decided to substitute my 6 bytes of ASCII text (all
 characters <128) with the Big5 from before (which contains some characters
 >= 128). I have no idea what happens if the choice of filename is
 ambiguous. If you rm the file this stops happening, obviously.

 This has almost nothing to do with character encoding.  It happens because
 a question mark happens to be a special character in shell filename
 expansion (wildcard).  Apparently in your case Bash substitutes each
 question mark to one byte, not one character.

 >   5. Type "./bytes foo=zw?A?n", with literal question marks. It shows
 *10 bytes of ASCII*. So Bash's weird encoding-fixing heuristic fails if
 command line arguments are more complex than just a file name by itself.

 In this case, the shell tries to expand “foo=zw?A?n” to a file name.
 Since there is no such file, Bash passes this argument as it is.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3307#comment:11>
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