cURL / Mailing Lists / curl-library / Single Mail


More fun with NTLM: Unicode support

From: Joshua Kwan <>
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:

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.

List admin:
Received on 2009-10-01