cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Curl and unicode file:// URLs on windows

From: jonas echterhoff <jonas_at_unity3d.com>
Date: Tue, 11 May 2010 07:48:17 -0700

On May 11, 2010, at 3:00 AM, curl-library-request_at_cool.haxx.se wrote:
>
> Right, I'm sure this is related to what function libcurl uses to open the
> file.
>
> Is _wopen() the one to use? I have no idea. Is it available for all compilers
> and windows versions?
>
> (Yes, this is the correct place to submit a bug and discuss fixes, but I
> personally am Windows-less and Windows-unaware so I don't know these things.)

I tend to avoid windows myself when I can, but I found other code on the web, which seems to handle it by converting UTF-8 to UTF-16, and then using the result with _wopen(). That is assuming that the file URL is defined to be in UTF8 format (which makes sense, imo, and is at least consistent with the mac, I don't know how other Unixes handle Unicode file names).

It is a Microsoft run-time library function, so I'd assume that it should be available to all compilers on windows. According to http://msdn.microsoft.com/en-us/library/z0kc8e3z(VS.80).aspx , it has been added in Windows NT 4.0 / Windows 2000.

jonas
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-05-11