Sending a mail twice is worse than sending it in HTML format ;-)
I answer on the HTML mail as in the other mail there seem to be problem with line endings.


I don't know what exactly you have configured, but the default encoding used in Cocoon for serialization should be UTF-8 (have a look on the serializer declarations in the components section, UTF-8 is default, if nothing is specified). But the default for the form-encoding is set in web.xml, if not set it's ISO-8859-1, but maybe this depends also on your servlet container or JVM. The problem is a mismatch between the both. Therefore a fix was added before release Cocoon 2.1.3, that set's the default serializer encoding (if nothing is specified) to the default form-encoding.

Of course it's difficult to say what exactly is wrong with your setup as many issues might play a role. But UTF-8 everywhere should work also with Chinese characters. What encoding has the form on the browser? And is this recognized correctly by the browser? Are you sure the resulting XML file is wrong and it's not maybe only a viewing problem when the editor can't handle the encoding?

Joerg

On 11.02.2004 10:31, ? ?? wrote:

I saw the woody's binding samples and use dom to save form data.I modified js like:
if (isbind=="true") {
document = loadDocument(documentURI);
// bind the document data to the form
form.load(document);
}
// shows the form to the user until is validated successfully
form.showForm(formname+"-display");
if (form.binding != null){
// bind the form's data back to the document
form.save(document);
cocoon.sendPage(formname+"-save",{"data":document});
} Object document is a dom object then.
I use a pipeline to display the result:
<map:match pattern="*-save">
<map:generate type="jxt" src="forms/{1}/test_data.xml" />
<map:serialize type="xml"/>
</map:match>
Everything goes fine until I enter Simplyfied Chinese in the form,the xml result apear wrong encoding character:
* * <laiwendanwei>*test*</laiwendanwei>
* * <shouwenmingcheng>*???�???*</shouwenmingcheng> <--error here
the form encoding is unicode.
If I use action to get the value from the context using JXPathContext is the same result?
It must be woody form binding encoding problem.
What can I do to solve the problem?
roy huang

Reply via email to