Kai,

I find it very unlikely that the binding would be causing this.
More likely the roundtrip to the browser is mixing up the encodings.

To prove my statement you could omit the form.showForm("..."); line from your script and check the debug output (my guess is that the characters will not have changed, so binding load&save do not tamper with encoding)

Alternatively you can also test the value of the title-widget on the form:
1/ after 'load' binding and before showform
2/ after showform and before 'save' binding

(you can do that with something along the lines of:

cocoon.log.debug("value in form after submit:"
  + form.lookupWidget('/title).getValue())

//warning: untested code above, you might need to check up the API for correct method-calls and arguments)



My guess is that the error will be present in the form-widget after form-submit, proving that the evil is in the browser-roundtrip. (and showing that binding has nothing to do with it, and should not be seen as the location for fixing this)



Now, assuming this is indeed caused in the browser roundtrip I advise you to check your cocoon-configuration (in web.xml) form-encoding should be set to utf-8 and your container-encoding to the one your servlet-container is using (most likely iso-8859-1, although some versions of jetty default to utf-8 IIRC)

regards,
-marc=



Kai Mütz wrote:
Hi,

within an application we are using the binding framework (Cocoon 2.1.8) to
bind a form to a very simple value object (which is someting similar to a
bookmark, i.e. a id and a title field. The form is prefilled by application
like this

var code= cocoon.parameters.code;
var title = cocoon.parameters.title;
var bookmark = new Packages.mypackage.Bookmark();
bookmark.setCode(code);
if (cocoon.log.isDebugEnabled()) {
        cocoon.log.debug("[addBookmark()] Title: " + title);
}
bookmark.setTitle(title);
if (cocoon.log.isDebugEnabled()) {
        cocoon.log.debug("[addBookmark()] Bookmark Title: "
                + bookmark.getTitle());
}
form.load(bookmark);
form.showForm("addBookmark-form");
form.save(bookmark);
if (cocoon.log.isDebugEnabled()) {
        cocoon.log.debug("[addBookmark()] Bookmark Title: "
                + bookmark.getTitle());
}

If the string stored in variable title contains special characters (e.g.
– or –) they are gone after saving the form. I.e. the first two
debug messages are displayed correctly whereas the third debug message
contains a ? whereever a ndash occurs in the original text. The text is
displayed correctly within the form input field as well. This might be a
encoding problem. Can anybody help me?

The binding is very simple:

<fb:context xmlns:fb="http://apache.org/cocoon/forms/1.0#binding"; path="/">
    <fb:value id="code" path="code"/>
    <fb:value id="title" path="title"/>
</fb:context>

Any help appreciated,

Kai


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to