myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Nicolucci <pnico...@us.ibm.com>
Subject MyFaces Encoding Question
Date Thu, 14 Feb 2013 02:14:28 GMT

Hello Everyone,

 I have a page that uses UTF-8 and another that use BIG5.  Each of these
pages contains some Chinese characters.    The problem I'm having is that
MyFaces seem to be adding  "&#" to the front of each of these characters
and returning their int representation.  This is being done in the
UnicodeEncoder.  This only
seems to happen with a third party tag ( not a core MyFaces tag ).

I've been debugging through and it looks like if we are not UTF-8 then we
do this unicode encoding.  The tag being used just seems to use the MyFaces
HtmlResponseWriterImpl and
then render what is returned and in this case it ends up being the unicode
in the format &#(int representation of chinese character)

An example call stack:

org.apache.myfaces.shared_impl.renderkit.html.util.UnicodeEncoder.encode
(UnicodeEncoder.java:75)
at
org.apache.myfaces.shared_impl.renderkit.html.HtmlResponseWriterImpl.write
(HtmlResponseWriterImpl.java:896)
at
org.apache.myfaces.shared_impl.renderkit.html.HtmlTextRendererBase.renderOutputText
(HtmlTextRendererBase.java:143)
at
org.apache.myfaces.shared_impl.renderkit.html.HtmlTextRendererBase.renderOutput
(HtmlTextRendererBase.java:104)
at
org.apache.myfaces.shared_impl.renderkit.html.HtmlTextRendererBase.encodeEnd
(HtmlTextRendererBase.java:79)
at com.ibm.faces.renderkit.DefaultAjaxRenderer.encodeEnd
(DefaultAjaxRenderer.java:83)
at javax.faces.component.UIComponentBase.encodeEnd
(UIComponentBase.java:535)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:626)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:622)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:622)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:622)
at
org.apache.myfaces.shared_impl.view.JspViewDeclarationLanguageBase.actuallyRenderView
(JspViewDeclarationLanguageBase.java:347)
at
org.apache.myfaces.shared_impl.view.JspViewDeclarationLanguageBase.renderView
(JspViewDeclarationLanguageBase.java:186)
at org.apache.myfaces.application.ViewHandlerImpl.renderView
(ViewHandlerImpl.java:263)
at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute
(RenderResponseExecutor.java:85)
at org.apache.myfaces.lifecycle.LifecycleImpl.render
(LifecycleImpl.java:239)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:191)

Is this the intended behavior? How to work around it? I've ensured that the
following is in the JSP:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@page language="java" contentType="text/html; charset=BIG5"
	pageEncoding="BIG5"%>
<%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<html>
<meta http-equiv="Content-Type" content="text/html; charset=BIG5">

Any help is much appreciated!!!!

Regards,

Paul Nicolucci
Mime
View raw message