I met this problem too, I use Myfaces, standalone Tiles, I spend about 2 weeks on this problem, but today I found a property in <f:view> and I wrote <f:view local="zh">, and then everything is ok, I wrote some Chinese in <h:inputText> and submit it, yeah! It works well!

On 1/8/06, Dave <[EMAIL PROTECTED]> wrote:
It was <t:buffer> that caused the encoding problem. I used <t:buffer> in my code.
 
I tried the following simple example without <t:buffer>, it worked fine without problem in typing/displaying back East asia characters. If I wrap the code with <t:buffer>, and output the buffer, it will not work, displaying  East Asia characters back as question marks.
 
I thought <t:buffer> is just a piece of memory without any character conversion. How does <t:buffer> work exactly? what OutputStream is being used? is it possibly involving data conversion? If yes, is there any workaround?
 
Thanks!
 
------------without <t:buffer>, works!----
 
<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
<HTML>
<head>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=UTF-8">
</head>
<body>
<f:view>
<h:outputText value="#{testBean.name}" />
<h:form>
<h:inputText value="#{testBean.name}"/>
<h:commandButton value="Submit" />
</h:form>
</f:view>
</body>
</HTML>
 
------------------------------------use <t:buffer>, does not work ----
 
<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
<HTML>
<head>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=UTF-8">
</head>
<body>
<f:view>
<t:buffer into="#{buf}">
<h:outputText value="#{testBean.name}" />
<h:form>
<h:inputText value="#{testBean.name}"/>
<h:commandButton value="Submit" />
</h:form>
</t:buffer>
<h:outputText value="#{buf}" escape="false" />
</f:view>
</body>
</HTML>

Reply via email to