A filter should do the trick:

Add this to your web.xml:
<web-app>
   <display-name>My App Name</display-name>
     <filter>
    <filter-name>Set Character Encoding</filter-name>
   
<filter-class>com.mydomain.myapp.filter.SetCharacterEncodingFilter</filter-class>
    <init-param>
      <param-name>encoding</param-name>
      <param-value>UTF-8</param-value>
    </init-param>
  </filter>
    <filter-mapping>
    <filter-name>Set Character Encoding</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>

Then add the SetCharacterEncodingFilter class to your web app.  The
filter usually ships with Tomcat(if that's what you are using)
I found mine here:
/jakarta-tomcat-5.0.28/webapps/servlets-examples/WEB-INF/classes/filters/SetCharacterEncodingFilter.java

Cheers,

David


Rafał Gierusz wrote:

>NB> there are many different places where encoding can be set.  what is
>NB> the encoding of your *.vm files?  in your velocity.properties are you
>NB> setting either the input.encoding, output.encoding, or
>NB> default.contentType?  i think struts might have some places to set
>NB> encodings as well.
>
>1) my *.vm file are written in UTF-8 and inside is XHTML with 
>content="text/html; charset=UTF-8"
>2) my velocity.properties are set to:
>
>input.encoding=UTF-8
>output.encoding=UTF-8
>
>3) my resource file is written using UTF-8
>4) my locale is "pl", I set encoding for this locale in web.xml to
>UTF-8
>5) my HttpRequest charset encoding is set to UTF-8
>
>I've tried everything but I can't get correct text from resources at
>*.vm page using MessageTool
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to