curl-users
Unicode filename [Urgent Help Needed]
Date: Sun, 29 Aug 2010 18:03:13 +0300
Hello Everyone,
Environment:
1.Linux CentOS 5
2.Windows Cygwin
I'm working on a project which let users to download files from my forum
through curl, but the problem that most of files in my forum are named in
non-english chars, and when they are saved to the computer they saved in
wrong name and even when they appeared in the command line they appear in
wrong way, here an example for an file which has most of his chars in
English
The real file name: Arena of Doom Interactive [Mod 240x32] by taka (1).zip
How it's appear after entering this command and enable file name to be
printed from content-disposition header by editing this line in main.c line
5422
from:
if (config->content_disposition && outs.stream && !config->mute)
printf("curl: Saved to filename '%s'\n", outs.filename);
to:
if (config->content_disposition)
printf("outs.filename");
Command:-
$ curl -sOLJ --cookie /home/AG/cookies/coke2 -w
",%{url_effective},%{size_download},"'%{content_type}'"\n"
http://www.network.com/attachment.php?attachmentid=123123 | sed 's/ //g'
Result:-
Arena20165750foomnteractive5BModMod032yaka.zip,
http://www.network.com/attachment.php?attachmentid=123123,2455,application/zip
and when it saved it saved with following
name: Arena%20of%20Doom%20Interactive%20%5BMod%20240x32%5D%20by%20taka.zip
So could any one help to get the file saved with the correct name and to
appear in the studin with the correct name?
Any help will be much appreciated.
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-08-29