Forum: NGINX when download a file named with english and num and chinese character,the file name is garbled

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
49d68f4402d8f4eba3d3c373d89d1913?d=identicon&s=25 lhmwzy (Guest)
on 2009-02-03 10:26
(Received via mailing list)
When download a  file  named with english and num and chinese
character,ÇÉ»¢¿ìÀÖ°æ2008Äê12ÔºÅDVD0812.iso,for example,the file name will
garbled like
"%c7%c9%bb%a2%bf%ec%c0%d6%b0%e62008%c4%ea12%d4%c2%ba%c5DVD0812.iso",
how to solve the problem?
22f663d0fc5bfe9e3a05af782f205fa4?d=identicon&s=25 CryptWizard (Guest)
on 2009-02-03 10:40
(Received via mailing list)
That is not a problem.
Or if you so consider it to be one, check your browser or download
manager.

2009/2/3 lhmwzy <lhmwzy@gmail.com>
7ce625ba598c1198061bdf1b1a1353a5?d=identicon&s=25 dennis cao (Guest)
on 2009-02-03 10:53
(Received via mailing list)
it may be convert to urlcode

Date: Tue, 3 Feb 2009 20:30:41 +1100Subject: Re: when download a file
named with english and num and chinese character,the file name is
garbledFrom: cryptwizard@gmail.comTo: nginx@sysoev.ruThat is not a
problem.Or if you so consider it to be one, check your browser or
download manager.
2009/2/3 lhmwzy <lhmwzy@gmail.com>
When download a  file  named with english and num and
chinesecharacter,ÇÉ»¢¿ìÀÖ°æ2008Äê12ÔºÅDVD0812.iso,for example,the file name
willgarbled like
"%c7%c9%bb%a2%bf%ec%c0%d6%b0%e62008%c4%ea12%d4%c2%ba%c5DVD0812.iso",how
to solve the problem?
Faf3b56a44269e2c5b92cf97435e29f6?d=identicon&s=25 Petite Abeille (Guest)
on 2009-02-03 20:28
(Received via mailing list)
On Feb 3, 2009, at 10:14 AM, lhmwzy wrote:

> When download a  file  named with english and num and chinese
> character,ÇÉ»¢¿ìÀÖ°æ2008Äê12ÔºÅDVD0812.iso,for example,the file name
> will
> garbled like "%c7%c9%bb%a2%bf%ec%c0%d6%b0%e62008%c4%ea12%d4%c2%ba
> %c5DVD0812.iso",

It should be

%e5%b7%a7%e8%99%8e%e5%bf%ab%e4%b9%90%e7%89%882008%e5%b9%b412%e6%9c
%88%e5%8f%b7DVD0812.iso

instead, if I'm not mistaken.

E.g. UTF-8 + Percent-encoding (aka URL encoding) [1]

That said, because this data came via a HTML <form>, it might have
been encoded using the form's accept-charset instead of UTF-8:

http://www.w3.org/TR/html401/interact/forms.html#a...

> how to solve the problem?

(1) Percent decode the file name
(2) Convert the resulting byte stream into an Unicode representation
using the appropriate character set encoding

Nothing to do with nginx though....

HTH.

Cheers,

--
PA.
http://alt.textdrive.com/nanoki/


[1] http://en.wikipedia.org/wiki/Percent-encoding
This topic is locked and can not be replied to.