cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: UNICODE with libcurl on Win2K?

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Sat, 17 May 2003 17:50:19 -0700

On Fri, May 16, 2003 at 04:55:28PM -0400, Gerard Cheng wrote:
> Thank you for the reply.
>
> How can one detect which encoding the FTP server is expecting?
> Can this be done dynamically or does it need to be configured
> in advance?

You'd have to read the relevant RFCs to find out for sure. I suspect the
original FTP RFC specified commands and file names to use 7-bit ASCII only,
so any server serving internationalized file names would have to use some
kind of extension. Most modern protocols seem to specify UTF-8 for
everything since it's backwards-compatible with protocols that specify
everything in 7-bit; that would be a logical extension to internationalize
FTP, but barring an RFC that says so, an ftp server could use any method.

Of course there may be an RFC that specifies a standard already. I hope
someone will pipe up here if that's the case.

> Do FTP servers actually expect commands to be in the correct
> encoding as well? That is, just say the FTP server expects
> UTF-16, would the whole of the command:
> CWS PathWithNonISO8859Characters
> need to be encoded in UTF-16 or just the path?

The commands are always 7-bit ASCII.

> Would anyone know which encoding scheme the Win2K filesystem
> uses to store filenames? Is that what affect which encoding to
> send to the FTP server?

I'm just about positive it uses 16-bit wide UCS-2 which doesn't translate
directly to a byte-wide protocol like FTP. It's likely that if it
supports international characters at all, it will expect UTF-8 file names.

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
-------------------------------------------------------
This SF.net email is sponsored by: If flattening out C++ or Java
code to make your application fit in a relational database is painful, 
don't do it! Check out ObjectStore. Now part of Progress Software.
http://www.objectstore.net/sourceforge
Received on 2003-05-18