You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Arun Prasad R <fi...@gmail.com> on 2005/08/12 07:26:37 UTC

serving japanese file problem

i have a ウェブ.jpg (japanese filename) in images directory.
while requesting that file url encode to %E3%82%A6%E3%82%A7%E3%83%96.jpg

but tomcat doesn't serve ウェブ.jpg instead it says file not found.

my question is how to make tomcat to decode
%E3%82%A6%E3%82%A7%E3%83%96.jpg as ウェブ.jpg

Re: serving japanese file problem

Posted by Hiroshi Iwatani <HG...@nifty.ne.jp>.
Check whether EVERYTHING is UTF8 including file names on your OS
file system, JSP/servlet sourcfile encoding, request and response.

Arun Prasad R wrote:
> thanks Hiroshi,
> 
> I set -Dfile.encoding=UTF-8 while starting tomcat and my platform support 
> UTF-8 creation.
> 
> servlet is same as what u have specifed
> 
> but i get broken image(ie file not found)
> 
> arun
> 
> On 8/12/05, Hiroshi Iwatani <HG...@nifty.ne.jp> wrote:
> 
>>Your tomcat isn't running with UTF-8 and/or your platform doesn't use
>>UTF-8 for file name.
>>--------------------------------------------
>>On my Linux Fedora Core 3:
>>echo $LANG == ja_JP.UTF-8
>>means text file(including .java) and file name on OS file system
>>are created with UTF8 encoding.
>>
>>on our servlet:
>>String contType = "text/html;charset=UTF-8";
>>request.setCharacterEncoding("UTF8");
>>response.setContentType(contType);
>>//or, response.setCharacterEncoding("UTF8");
>>out.println("<IMG SRC=\"/" + text + ".jpg\">"); //text is a UTF8 String
>>
>>
>>Arun Prasad R wrote:
>>
>>>i have a ウェブ.jpg (japanese filename) in images directory.
>>>while requesting that file url encode to %E3%82%A6%E3%82%A7%E3%83%96.jpg
>>>
>>>but tomcat doesn't serve ウェブ.jpg instead it says file not found.
>>>
>>>my question is how to make tomcat to decode
>>>%E3%82%A6%E3%82%A7%E3%83%96.jpg as ウェブ.jpg
>>>
>>
>>--
>>Hiroshi Iwatani
>>
>>*stop cruelty* Annual number of institutionally euthanized cats and dogs
>>including kittens and puppies: US 5 million, JP 500 thousand. How about
>>your country? *for our better karma*
>>---------------------
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>
>>
> 
> 

-- 
Hiroshi Iwatani

*stop cruelty* Annual number of institutionally euthanized cats and dogs
including kittens and puppies: US 5 million, JP 500 thousand. How about
your country? *for our better karma*
---------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: serving japanese file problem

Posted by Arun Prasad R <fi...@gmail.com>.
thanks Hiroshi,

I set -Dfile.encoding=UTF-8 while starting tomcat and my platform support 
UTF-8 creation.

servlet is same as what u have specifed

but i get broken image(ie file not found)

arun

On 8/12/05, Hiroshi Iwatani <HG...@nifty.ne.jp> wrote:
> 
> Your tomcat isn't running with UTF-8 and/or your platform doesn't use
> UTF-8 for file name.
> --------------------------------------------
> On my Linux Fedora Core 3:
> echo $LANG == ja_JP.UTF-8
> means text file(including .java) and file name on OS file system
> are created with UTF8 encoding.
> 
> on our servlet:
> String contType = "text/html;charset=UTF-8";
> request.setCharacterEncoding("UTF8");
> response.setContentType(contType);
> //or, response.setCharacterEncoding("UTF8");
> out.println("<IMG SRC=\"/" + text + ".jpg\">"); //text is a UTF8 String
> 
> 
> Arun Prasad R wrote:
> > i have a ウェブ.jpg (japanese filename) in images directory.
> > while requesting that file url encode to %E3%82%A6%E3%82%A7%E3%83%96.jpg
> >
> > but tomcat doesn't serve ウェブ.jpg instead it says file not found.
> >
> > my question is how to make tomcat to decode
> > %E3%82%A6%E3%82%A7%E3%83%96.jpg as ウェブ.jpg
> >
> 
> --
> Hiroshi Iwatani
> 
> *stop cruelty* Annual number of institutionally euthanized cats and dogs
> including kittens and puppies: US 5 million, JP 500 thousand. How about
> your country? *for our better karma*
> ---------------------
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
>

Re: serving japanese file problem

Posted by Hiroshi Iwatani <HG...@nifty.ne.jp>.
Your tomcat isn't running with UTF-8 and/or your platform doesn't use
UTF-8 for file name.
--------------------------------------------
On my Linux Fedora Core 3:
echo $LANG == ja_JP.UTF-8
means text file(including .java) and file name on OS file system
are created with UTF8 encoding.

on our servlet:
String contType = "text/html;charset=UTF-8";
request.setCharacterEncoding("UTF8");
response.setContentType(contType);
//or, response.setCharacterEncoding("UTF8");
out.println("<IMG SRC=\"/" + text + ".jpg\">"); //text is a UTF8 String


Arun Prasad R wrote:
> i have a ウェブ.jpg (japanese filename) in images directory.
> while requesting that file url encode to %E3%82%A6%E3%82%A7%E3%83%96.jpg
> 
> but tomcat doesn't serve ウェブ.jpg instead it says file not found.
> 
> my question is how to make tomcat to decode
> %E3%82%A6%E3%82%A7%E3%83%96.jpg as ウェブ.jpg
> 

-- 
Hiroshi Iwatani

*stop cruelty* Annual number of institutionally euthanized cats and dogs
including kittens and puppies: US 5 million, JP 500 thousand. How about
your country? *for our better karma*
---------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: serving japanese file problem

Posted by Mark Thomas <ma...@apache.org>.
You need to change your connector element(s) in server.xml

Mark

Arun Prasad R wrote:
> thanks Mark,Hiroshi
> 
> but how do i specify this in tomcat configuration. in which config file i 
> need to change. what are the changes to be done to achive this.
> pls help. im newbie
> 
> arun
> 
> On 8/12/05, Mark Thomas <ma...@apache.org> wrote:
> 
>>Arun Prasad R wrote:
>>
>>>i have a ウェブ.jpg (japanese filename) in images directory.
>>>while requesting that file url encode to %E3%82%A6%E3%82%A7%E3%83%96.jpg
>>>
>>>but tomcat doesn't serve ウェブ.jpg instead it says file not found.
>>>
>>>my question is how to make tomcat to decode
>>>%E3%82%A6%E3%82%A7%E3%83%96.jpg as ウェブ.jpg
>>
>>
>>You should set the URIEncoding paramter of the connector to UTF-8.
>>
>>Mark
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>
>>
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: serving japanese file problem

Posted by Arun Prasad R <fi...@gmail.com>.
thanks Mark,Hiroshi

but how do i specify this in tomcat configuration. in which config file i 
need to change. what are the changes to be done to achive this.
pls help. im newbie

arun

On 8/12/05, Mark Thomas <ma...@apache.org> wrote:
> 
> Arun Prasad R wrote:
> > i have a ウェブ.jpg (japanese filename) in images directory.
> > while requesting that file url encode to %E3%82%A6%E3%82%A7%E3%83%96.jpg
> >
> > but tomcat doesn't serve ウェブ.jpg instead it says file not found.
> >
> > my question is how to make tomcat to decode
> > %E3%82%A6%E3%82%A7%E3%83%96.jpg as ウェブ.jpg
> 
> 
> You should set the URIEncoding paramter of the connector to UTF-8.
> 
> Mark
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
>

Re: serving japanese file problem

Posted by Mark Thomas <ma...@apache.org>.
Arun Prasad R wrote:
> i have a ウェブ.jpg (japanese filename) in images directory.
> while requesting that file url encode to %E3%82%A6%E3%82%A7%E3%83%96.jpg
> 
> but tomcat doesn't serve ウェブ.jpg instead it says file not found.
> 
> my question is how to make tomcat to decode
> %E3%82%A6%E3%82%A7%E3%83%96.jpg as ウェブ.jpg


You should set the URIEncoding paramter of the connector to UTF-8.

Mark


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org