views:

29

answers:

1

I am using the image tag as

<image src="/data/image/image.txt" />

the path /data/image/image.txt does exists.

and it displays the image also.

but when i introduce some i18n characters in the path lets say

<image src="/data/image组织/image.txt" />

it says 404 error image not found, but the path /data/image组织/image.txt does exists,

please help me to find the solution for this?

I used the firebug also to see whether the characters are decoded properly or not, in firebug I am able to see the correct characters they are not changed, still it is not able to pick the image.

thanks a lot in advance.

Note: I am using <image> tag because it was not allowing me to write the img tab in the post, and i have changed the jif ext to txt.

please consider this.

A: 

Unicode characters ARE legal in the portion of the URL you're putting them in, so you have a problem somewhere else - probably on your web server. Check your web server logs to make sure that the 404 that is issued is for the URL you think you're requesting on the web browser side - you may find that there's a mismatch in the encoding that the browser uses and the way that the server parses it (if your server is capable of serving up an internationalized URI in the first place). Keep in mind that your filesystem also needs to support unicode and your web server needs to respect your filesystem encoding.

Also, since you didn't make it clear that you were using unicode (which would be the "easy" way), non-unicode characters are also legal but the situation is a lot trickier. Once you start introducing non-unicode character sets like Shift-JIS, you massively increase the number of tools that need to understand and not screw up your character encoding along the way.

Nick Bastin
Non-ASCII characters in URIs are not legal (see RFC 3986), but the contents of img/@src in HTML is not a URI, so this can be made to work, assuming that web page and web server agree on what encoding is used (the request goes over HTTP, which *is* plain ASCII in request line).
Julian Reschke
Bah, I meant URL. The only part of the GET line in a header that has to be in latin-1 (and even less, actually - some characters are reserved) is the host component. The path after the host is resolved can be in ANY encoding the client and server can agree on.
Nick Bastin
Hi All,for the same request i am having "Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7 "in my request headerwheras "Content-Type text/html;charset=utf-8"in my response header.where I am pasing the " src=portal/modules/fw/my组织/homepage_title.gif "and the request generated is" https://<ip:port>/nps/portal/modules/fw/my%E7%BB%84%E7%BB%87/homepage_title.gif "and the response says "The requested resource (/nps/portal/modules/fw/my%E7%BB%84%E7%BB%87/homepage_title.gif) is not available."please let me know if I m missing something.