[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
- To: openldap-its@OpenLDAP.org
- Subject: Re: (ITS#7992) lmdb: Windows: assume file paths are UTF-8, encode to UTF-16 for WinAPI and enable compiling when UNICODE is defined
- From: h.b.furuseth@usit.uio.no
- Date: Sat, 27 Aug 2016 10:05:30 +0000
- Auto-submitted: auto-generated (OpenLDAP-ITS)
Seems the test for MultiByteToWideChar() == 0xFFFD can be dropped.
The MultiByteToWideChar doc mentions U+FFFD under Return Value.
But when I test bad UTF-8 characters, it inserts 0xFFFD for the
bad character(s) in the output string. It doesn't return 0xFFFD.
Or if we pass the MB_ERR_INVALID_CHARS flag, it returns 0 and sets
GetLastError() as usual.
(I wonder if I had a hand in this code - looks like my kind of
thing to write a draft from the Windows doc but leave the
Windows testing to someone else:-)