Support UTF8<=>Unicode filename mappingtn/utf8
commit45867beb1b85a258482431cff2d8268fea4bc7ca
authorThorvald Natvig <slicer@users.sourceforge.net>
Mon, 10 Aug 2009 21:44:10 +0000 (10 23:44 +0200)
committerThorvald Natvig <slicer@users.sourceforge.net>
Tue, 11 Aug 2009 15:18:02 +0000 (11 17:18 +0200)
tree39831d947e5044a288707f212d45db8cc4c8e6fc
parent4df89538f7912e73d822e16f5a26f00f0e4ca5d6
Support UTF8<=>Unicode filename mapping

Replaces all file functions with wrappers to their W equivlanets, removing
the need for all A functions.
This means full support for all paths, including paths that contain
characters outside the 8-bit locale, which used to fail.
utf8-to-unicode is handled by utf8_to_wchar, which has 4 static buffers it
rotates. We need at least 2 for symlink(), rename() etc, so we use 4 to be
on the safe side.
unicode-to-utf8 is handled by our own version of wcstombs(). For all calls
where we need unicode-to-utf8, the destination buffer is passed from the
original caller, so we use that directly.
Replaces GetFileAttributes in lstat() with the slightly faster
FindFirstFile, which also makes the symlink handling much cleaner.
compat/mingw.c
compat/mingw.h