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:
<?xml version="1.0" encoding="utf-8"?>
<wd:form xmlns:wd="http://apache.org/cocoon/woody/definition/1.0">
<wd:field id="dfcode" required="true">
<wd:label>Defect Code:</wd:label>
<wd:datatype base="string">
<wd:validation>
<wd:length min="6"/>
<wd:length max="10"/>
</wd:validation>
</wd:datatype>
</wd:field>
<wd:label>Defect Code:</wd:label>
<wd:datatype base="string">
<wd:validation>
<wd:length min="6"/>
<wd:length max="10"/>
</wd:validation>
</wd:datatype>
</wd:field>
......
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");
// 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
Do You Yahoo!?
嫌邮箱太小?雅虎电邮自助扩容!
