Japanese character is broken with jscookMenu
--------------------------------------------
Key: MYFACES-95
URL: http://issues.apache.org/jira/browse/MYFACES-95
Project: MyFaces
Type: Bug
Environment: Other than iso-8859-1 environment.
Reporter: Takashi Okamoto
Hi,
jscookMenu could not display Japanese character correctly. Following patch
resolves this problem.
Index:
src/components/org/apache/myfaces/custom/navmenu/jscookmenu/HtmlJSCookMenuRenderer.java
===================================================================
RCS file:
/home/cvspublic/incubator-myfaces/src/components/org/apache/myfaces/custom/navmenu/jscookmenu/HtmlJSCookMenuRenderer.java,v
retrieving revision 1.12
diff -u -r1.12 HtmlJSCookMenuRenderer.java
---
src/components/org/apache/myfaces/custom/navmenu/jscookmenu/HtmlJSCookMenuRenderer.java
27 Dec 2004 04:11:11 -0000 1.12
+++
src/components/org/apache/myfaces/custom/navmenu/jscookmenu/HtmlJSCookMenuRenderer.java
29 Jan 2005 08:45:57 -0000
@@ -24,6 +24,7 @@
import org.apache.myfaces.renderkit.html.util.DummyFormResponseWriter;
import org.apache.myfaces.renderkit.html.util.DummyFormUtils;
import org.apache.myfaces.renderkit.html.util.JavascriptUtils;
+import org.apache.myfaces.renderkit.html.util.HTMLEncoder;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
@@ -170,7 +171,7 @@
writer.write("''");
}
writer.write(", '");
- writer.write(JavascriptUtils.encodeString(item.getLabel()));
+
writer.write(HTMLEncoder.encode(JavascriptUtils.encodeString(item.getLabel())));
writer.write("', ");
if (item.getAction() != null && ! item.isDisabled())
{
Above patch requires HTMLEncoder. Current HTMLEncoder is in src/myfaces.
JSCookMenu can refer HTMLEncoder because it is in src/components. I suggest
move HTMLEncoding into src/share. HTMLEncoding has common function and move to
src/share seems reasoable.
regards,
Takashi Okamoto
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira