cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-library Mailing List Archives

More fun with NTLM: Unicode support

From: Joshua Kwan <jkwan_at_vmware.com>
Date: Thu, 1 Oct 2009 13:24:40 -0700

So I've received another bug related to NTLM on my radar, it doesn't work when non-ASCII characters have to be passed in as part of the username or password. It turns out that this is because cURL does not set the UNICODE negotiation flag. This was briefly discussed on this ML earlier this year and nothing ever became of it:

http://curl.haxx.se/mail/archive-2009-02/0112.html

I poked around the source tree and noticed that cURL does not even try to link against iconv unless you manually configure it like that (even though 99% of the time it's going to be in C library anyway.) Why is this?

The gettext package provides a convenient macro to detect iconv support, so it could be as easy as that on POSIX platforms.

Additionally, for NTLM on Windows, we can use the built-in functions MultiByteToWideCharString etc. so we don't need to express a dependency on iconv just to get UNICODE auth support.

Also, since we use char* and not wchar_t for everything, would it be safe to say that the default codeset for the host should be UTF-8 these days? (ISO-8859-1 is *so* 20th century..) And I think that in the configure script, we should detect the platform and assign a suitable default codeset -- most of these are supersets of ASCII anyway so getting it wrong is not usually a problem.

I'm just trying to gauge what the official opinion of cURL developers is on the iconv front before I get to coding.

-Josh
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2009-10-01

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET