cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: utf8 support in libcurl

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 22 Mar 2012 09:09:22 +0100 (CET)

On Wed, 21 Mar 2012, JonathonS wrote:

> Does UTF8 need to be explicitly "enabled" in libcurl in order to use paths
> in UTF8? I am currently passing a UTF8 encoded path to curl_easy_setopt
> CURLOPT_CAINFO.
> (http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTCAINFO)
>
> The function seems to be failing and I believe it is because the path is not
> being interpreted as a UTF8 string.

It works fine on Linux so I assume you're talking about another operating
system.

We don't have special treatment for UTF8 anywhere in libcurl and I'm aware
that this is a problem where we for example use fopen() which on inferior
systems (like windows) don't work with unicode file names. I will gladly
accept patches that improve this situation. Personally I only run and develop
on Linux so I'm not in a good position to work on this or try it out.

In the case of CAINFO the case is probably one step trickier, as then we
simply pass on the file name to a 3rd party library. This SSL library (most
commonly perhaps OpenSSL) might have the same utf8 related issue as libcurl
itself has, so we will need to adress that issue specificaly for each SSL
library.

I don't know if OpenSSL has a way to enable utf8 file names and I don't know
the situation for any of the other SSL libraries either!

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2012-03-22