cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zheng jianjun <jianjun_zheng2...@yahoo.com.cn>
Subject Re: Codepage problem of FOM ?
Date Tue, 11 May 2004 14:02:02 GMT
thanks a lot Bruno, i tried the following :
 
1. set cocoon form-encoding utf-8
   
2. setup filter for Cocoon with codepage "utf8" , the same as Tomcat example does
 
it has the same result in above attempts , when the Chinese words 
are input into FOM variables , they failed to be shown correctly in another form , but they
could be inserted into database without any problem in the same flowscript by calling java
package. it seemed that request has no problem at all , problem happens to the respond encoding
.
 
could anybody advise what i had missed , please?
 
all woody form and template are in the format of utf8
 
thanks in advance,
best regards.
jianjun zheng.
 


Bruno Dumon <bruno@outerthought.org> wrote:
On Fri, 2004-05-07 at 09:53, zheng jianjun wrote:
> Hi ,
> 
> had anybody encountered the below codepage problem in flowscipt ?
> 
> my env : 
> 
> redhat 8.0 (en) + tomcat 4.1.27 + cocoon 2.1.2 + ie6.0 (Chinese
> version) 
> 
> cocoon2.1.2 : container and form encoding are default value iso-8859-1
> ie6.0 : always send URL in UTF-8 = true
> 
> a simple woody form , which had been saved as static file in
> codepage uft-8:
> 
> 
> 
> 
> Defect Code:
> 
> 
> 
> 
> 
> 
> 
> ......
> 
> 
> the flow script is something like following:
> 
> .....
> var form = new Form("forms/myform.xml");
> var model = form.getModel();
> var myaction = Packages.mypkg.dbActions();
> model.dfcode = "";
> ....
> form.showForm("displays/screen1.xml");
> // a Chinese word had input into model.dfcode
> ...
> 
> // insert it into database , the below statement worked well 
> myaction.insert(String(model.dfcode));
> ...
> 
> model.dfcode = new
> Packages.java.lang.String((Packages.java.lang.String(model.dfcode)).getBytes("iso-8859-1"),"gb2312");

what you do here shouldn't ever be needed.

ISO-8859-1 doesn't support chinese characters, so use UTF-8 instead and
remove hacks like the one above.

I remember seeing some noise about Tomcat problems with regards to
encoding, but I don't know anything about it.

> 
> // Chinese word cannot be shown in following showFrom statement
> without the above 
> 
> form.showForm("displays/screen2.xml");
> // the variable dfcode was shown again in this form
> 
> any idea of what is the problem ? 
> 
> thanks 
> with regards.
> j.j.zheng
> 

-- 
Bruno Dumon http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org bruno@apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org



---------------------------------
Do You Yahoo!?
嫌邮箱太小?雅虎电邮自助扩容!
Mime
View raw message