On Fri, 2003-12-26 at 21:42, Peter Moulder wrote:
open()/readdir() etc. take as argument a nul-terminated string of bytes, not some notion of characters. preferences.xml should store filenames as such.
Unless we were to use e.g. base64 encoding, there would be no XML-conformant way to store that in preferences XML.
In any case, we'd still need to store the UTF-8 filename, if only for display in the UI.
An even more interesting question is how things would work when preferences were shared between systems (e.g. a shared home directory).
On some platforms (e.g. Darwin/Mac OS X) where open()/readdir() use a specific, fixed, encoding, which has certain validity rules -- i.e. you _can't_ just give it an arbitrary byte stream (even if such a filename already exists in the filesystem).
To be honest, I really think this isn't our problem to fix. The best we can do is use UTF-8 internally, and call open() and friends with the string converted to LC_CTYPE.
-mental