Solution: File encoding not getting set (using JVM option in service.bat)
- From: Sriram Subramanian <sriram_idm (at) yahoo.com>
- Date: Thu, 2 Feb 2006 19:22:13 -0800 (PST)
Hi Mark, and others,
So I did find a way to set the encoding for the JVM
(and hence Tomcat 5.5 which uses this jvm and runs as
a windows service). Just add another update statement
in service.bat:
//US//SelectFederation ++JvmOptions
"-Dfile.encoding=UTF-8"
Regards,
Sriram
--- Mark Thomas <med.thomas (at) virgin.net> wrote:
> Sriram Subramanian wrote:
> > Mark, I see your point related to file encoding
> > changes working on select OS/JVM combinations, why
> is
> > probably why setting LANG=en_US.UTF-8 in
> catalina.sh
> > does the trick on Unix. There's got to be some
> > workaround for Windows.
> > My aim is to force Tomcat to use UTF-8. We have a
> EAR
> > that is deployed on Tomcat, and setting the file
> > encoding to UTF-8 would help satisfy i18n
> requirements
> > for the product. Otherwise for e.g. japanese
> usernames
> > would be seen as ???.
>
> You can't really "force" Tomcat to use UTF-8 since a
> lot of the
> encoding is under the control of the developer.
> However what you can
> do is:
> 1) set URIEncoding="UTF-8" on the connector - this
> will help with any
> query parameters
> 2) setting fileEncoding="UTF-8" on the default
> servlet will help if
> you have any UTF-8 encoded static resources
> 3) Code the application carefully ;). This one is
> where people usually
> come unstuck. Search the archives for encoding
> filters. You should
> find some resources that may help you if you have
> problems here but be
> aware that these are sticking plasters for
> application problem rather
> than the "right" solution.
>
> The test JSP in this post may also help you.
>
http://marc.theaimsgroup.com/?l=tomcat-user&m=108896683306201&w=2
>
> You should be able to paste any text (Japanese,
> Chinese, English...)
> into the input text box and see the exact same text
> echoed back.
>
> Mark
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> users-unsubscribe (at) tomcat.apache.org
> For additional commands, e-mail:
> users-help (at) tomcat.apache.org
>
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe (at) tomcat.apache.org
For additional commands, e-mail: users-help (at) tomcat.apache.org