[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: (ITS#7992) lmdb: Windows: assume file paths are UTF-8, encode to UTF-16 for WinAPI and enable compiling when UNICODE is defined



On 20/11/15 02:16, hyc@symas.com wrote:
>> Also use CreateFileW to open files so that one can use exotic characters in
>> paths. The library interface is not modified, but the code makes an assumption
>> that paths passed to lmdb functions are encoded as UTF-8. The UTF-8 encoded
>> paths are encoded to UTF-16 which is then passed to CreateFileW.
>
> This patch is now in git mdb.master.

Needs cleanup:

utf8_to_utf16() ignores errors in malloc/MultiByteToWideChar().
utf8_to_utf16()'s callers ignore error returns.

utf8_to_utf16() can return EILSEQ, an errno code not listed in
mdb_strerror(). It should return a Windows error code or a new
MDB_<SOMETHING> code.

(LMDB returns LDMB codes or system error codes. The latter are
errno codes on Unix and Windows codes on Windows - except
mdb_strerror's hardcoded errno codes which we plan to get rid of.)