[jboss-user] [JBoss Seam] - Re: m:subject always HTML encodes strings

jarkko@jab.fi do-not-reply at jboss.com
Sun Sep 30 22:58:12 EDT 2007


FaceletsRendered$Context.wrap()  calls facesContext.setResponseWriter with null character encoding. This causes HtmlRenderKitImpl.createResponseWriter  to default to ISO-8859-1 encoding which further causes the usage of UnicodeEncoder (delegate.write(String) in MailResponseWriter.write(String)) later on which translates äää --> 

  |          // Wrap the ResponseWriter
  |          originalResponseWriter = facesContext.getResponseWriter();
  |          facesContext.setResponseWriter(facesContext.getRenderKit().createResponseWriter(writer,
  |                   null, null));
  | 


  | Class org.apache.myfaces.shared_impl.renderkit.html.HtmlResponseWriterImpl.java:
  | 
  |  public void write(String str) throws IOException
  |     {
  |         closeStartTagIfNecessary();
  |         // empty string commonly used to force the start tag to be closed.
  |         // in such case, do not call down the writer chain
  |         if (str.length() > 0)
  |         {
  |             // Don't bother encoding anything if chosen character encoding is UTF-8
  |             if (UTF8.equals(_characterEncoding)) _writer.write(str);
  |             else _writer.write(UnicodeEncoder.encode(str) );
  |         }
  |     }
  | 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4090075#4090075

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4090075




More information about the jboss-user mailing list