[darcs-users] [patch252] Resolve issue1763: use correct filename encoding in co...

Reinier Lamers bugs at darcs.net
Thu May 27 21:22:27 UTC 2010


Reinier Lamers <tux_rocker at reinier.de> added the comment:

Hi all,

Op donderdag 27 mei 2010 20:27 schreef Eric Kow:
> Also what do you mean when you say Unix?  I hope that's not a dumb
> question.  I just hear that on MacOS X you have this thing going on
> where filenames are automagically normalised into NFD?  So presumably
> somewhere along the way you have some kind of low-level Unicode
> awareness as opposed to treating filenames as just sequences of bytes.

I don't know about OS X. I have the same question you have here.

> Also should we be worrying about what happens with Windows?

On Windows, filenames are Unicode strings and not sequences of bytes as on 
Linux. This discrepancy can bring down Java actually. Try creating a file with 
an invalid UTF-8 name and feeding it to a Java program via the command line on 
a modern Linux distro. Java won't be able to find it.

I talked about this with Duncan Coutts on #ghc and he said that this is why 
command line arguments are always interpreted as latin1 by GHC. So even a file 
has a name with multibyte characters, you'll get the individual bytes as 
Char's in the String's that you get from getArgs. So these Char's should be < 
256 and should work. But I admit that sounds a bit flaky.

Petr's solution looks alright to me BTW.

Reinier





> 
> -- 
> Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
> PGP Key ID: 08AC04F9
> 
> __________________________________
> Darcs bug tracker <bugs at darcs.net>
> <http://bugs.darcs.net/patch252>
> __________________________________
> _______________________________________________
> darcs-users mailing list
> darcs-users at darcs.net
> http://lists.osuosl.org/mailman/listinfo/darcs-users
>

----------
nosy: +tux_rocker

__________________________________
Darcs bug tracker <bugs at darcs.net>
<http://bugs.darcs.net/patch252>
__________________________________


More information about the darcs-users mailing list