[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Unicode and the io, os, and lfs libraries on Windows
- From: Matt Campbell <mattcampbell@...>
- Date: Tue, 13 Nov 2007 15:50:44 -0600
As I mentioned the other day, I've been developing a collection of Win32
API bindings. These bindings all use the Unicode versions of their
corresponding Win32 functions; they take and return UTF-8 strings. Now,
the problem is that the io, os, and lfs libraries don't take or return
UTF-8 strings on Windows; they use the system's default code page, which
is never UTF-8 (how I wish it was!). This means that if I do something
appDataDir = shlobj.GetSpecialFolderPath(nil, shlobj.CSIDL_APPDATA)
f = io.open(appDataDir .. "\\foo.cfg")
the second statement won't work if the application data directory
contains non-ASCII characters.
For consistency and to avoid debugging headaches on non-English Windows,
I want to use UTF-8 everywhere. How should I solve this problem?