DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26687>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26687

add encoding elements to web.xml to avoid missmatch encoding.

           Summary: add encoding elements to web.xml to avoid missmatch
                    encoding.
           Product: Tomcat 5
           Version: 5.0.0
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Jasper
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


Inside the validate method in Validator class, the source code:
if(charset == null)
      charset = isXml ? "UTF-8" : "ISO-8859-1";
Is buggy - why every time i use JSPs, for example, the encoding must be ISO-
8859-1? If you can export the encoding to be user choice, by taking them from 
the web.xml you increase the flexibility of the use of other documents types, 
except XML, for International use, and increase the I18N support.
Our solution for it is:
if(charset == null)
       //charset = isXml ? "UTF-8" : "ISO-8859-1";
       {
             org.apache.jasper.EmbededServletOptions opt =
               (org.apache.jasper.EmbededServletOptions)
                 compiler.ctxt.getOptions();
              charset = isXml ? opt.getProperty("xmlEncoding") : 
                                opt.getProperty("htmlEncoding");
              if(charset == null)
                 charset = "UTF-8";
            }

We added xmlEncoding and htmlEncoding to the web.xml and set the default if not 
defined to "UTF-8" which is the preffered global encoding if not specified.

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

Reply via email to