[ 
http://mifosforge.jira.com/browse/MIFOS-4789?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=66012#comment-66012
 ] 

Michael Vorburger edited comment on MIFOS-4789 at 3/3/11 4:24 PM:
------------------------------------------------------------------

Note: Servlet Spec 5.4 says that "If the servlet does not specify a character 
encoding before the getWriter method of the ServletResponse interface is called 
or the response is committed, the default ISO-8859-1 is used."

I'm unclear why, sometimes, it worked before, but as there doesn't seem to be 
any other mechanism in Mifos to force (JSP) output to UTF-8, my best guess is 
that "by chance it sometimes worked before" - and that the "solution" is to "do 
something explicit to force UTF-8" in responses.

A Servlet Filter to force the encoding to UTF-8 actually was a good idea to 
start with.  There were two main problems with it though: 

1. Struts uses RequestDispatcher.forward() which, under Jetty 7.3.0 at least, 
cleared the encoding set by the filter and made the JSPs be served with the 
default ISO-8859-1 again.  Solved this via <dispatcher>FORWARD</dispatcher> in 
the <filter-mapping> (I've set all 5 types, just to be safe).

2. Spring's org.springframework.web.filter.CharacterEncodingFilter actually 
won't work because (I think) their OncePerRequestFilter; I suspect this may 
turn out to be a subtle Spring bug, I've created 
https://jira.springsource.org/browse/SPR-8019 for follow up on a separate 
thread; solved short-term with our own 
org.mifos.servlet.filters.CharacterEncodingFilter.

      was (Author: vorburger):
    Conclusion: A Filter to force the encoding to UTF-8 actually was a good 
idea to start with.  There were two main problems with it though: 

1. Struts uses RequestDispatcher.forward() which, under Jetty 7.3.0 at least, 
cleared the encoding set by the filter and made the JSPs be served with the 
default ISO-8859-1 again.  Solved this via <dispatcher>FORWARD</dispatcher> in 
the <filter-mapping> (I've set all 5 types, just to be safe).

2. Spring's org.springframework.web.filter.CharacterEncodingFilter actually 
won't work because (I think) their OncePerRequestFilter; I suspect this may 
turn out to be a subtle Spring bug, I've created 
https://jira.springsource.org/browse/SPR-8019 for follow up on a separate 
thread; solved short-term with our own 
org.mifos.servlet.filters.CharacterEncodingFilter.
  
> can't see Chinese: app server sends non-UTF-8 charset in response headers for 
> old ui (Struts/JSP)
> -------------------------------------------------------------------------------------------------
>
>                 Key: MIFOS-4789
>                 URL: http://mifosforge.jira.com/browse/MIFOS-4789
>             Project: mifos
>          Issue Type: Bug
>          Components: Build and Testing, Internationalization, Localization
>    Affects Versions: Release G
>         Environment: Chinese head/master test server running 
> head-master-archive build #73. Multiple browsers/operating systems.
>            Reporter: Adam Monsen
>            Assignee: Sumit Shah
>            Priority: Critical
>              Labels: chinesetranslation, volunteer
>             Fix For: Release G - Iteration 2, Release G
>
>
> Jetty is incorrectly setting a non-UTF-8 character set for Struts/JSP pages. 
> I'm using Google Chrome's developer tools to view the response headers, but 
> other software (ie: firefox plugins) can also be used to view response 
> headers.
> h1. Expected
> {noformat}Content-Type:text/html;charset=UTF-8{noformat}
> SpringMVC/ftl pages work. For example: http://ci.mifos.org:8118/mifos/
> h1. Actual
> {noformat}Content-Type:text/html;charset=ISO-8859-1{noformat}
> For example: 
> http://ci.mifos.org:8118/mifos/custSearchAction.do?method=getHomePage

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
What You Don't Know About Data Connectivity CAN Hurt You
This paper provides an overview of data connectivity, details
its effect on application quality, and explores various alternative
solutions. http://p.sf.net/sfu/progress-d2d
_______________________________________________
Mifos-issues mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mifos-issues

Reply via email to