Building libcurl on MS-Windows with UNICODE defined
Date: Mon, 10 Oct 2011 18:13:03 -0700
The makefiles supplied with libcurl for MS-Windows do not define UNICODE. If "-DUNICODE=1" is added in Makefile.m32, warnings are given for these functions that expect WCHAR (or TCHAR) rather than char:
I don't know whether this significantly affects the operation of libcurl as it is actually used. If libcurl needs any of these functions to handle non-Latin strings, it will presumably fail.
For example, the second argument to ldap_simple_bind_s() is a user name; is it safe to assume the user name can be written with the ANSI character set? For FormatMessage(), is it safe to assume that error messages will always be written with the ANSI character set?
It appears that LoadLibrary() is only used in libcurl for ASCII strings, so that's not a problem.
It would be trivial to make libcurl compile without warnings with UNICODE defined, simply by suffixing the function names with "A"; for example, ldap_simple_bind_sA(). Then it would compile and run OK, but it still wouldn't support non-Latin strings (probably MS-Windows would substitute question marks for the unsupported non-Latin characters). For some functions that's not a problem; it clearly would be fine to replace LoadLibrary() with LoadLibraryA().
Some libcurl code has already been customized for UNICODE, but so far as I can see, only for _WIN32_WCE (for embedded systems).
Is there any documentation of this issue for libcurl? I don't find any mention of it in the source code itself. Excuse me if the issue has already been addressed on this mailing list.
And, is there any interest in adding support for UNICODE? MS-Windows has supported Unicode since 1995, sixteen years ago. Half the world's population uses non-Latin scripts, and even for languages such as English, Unicode provides useful characters that aren't in the ANSI/Windows code pages.
文林 Wenlin Institute, Inc. Software for Learning Chinese
E-mail: email@example.com Web: http://www.wenlin.com
Telephone: 1-877-4-WENLIN (1-877-493-6546)
List admin: http://cool.haxx.se/list/listinfo/curl-library
Received on 2011-10-11