On 3 Dec 2004, at 14:47, Torsten Curdt wrote:

Mate,

Thanks for your reply.

I am not totally sure but...

Technique:
I read the XML Source to a String (to add to the textarea widget) like this:
var string = org.apache.avalon.excalibur.io.IOUtil.toString(
new java.io.BufferedInputStream(
org.apache.cocoon.components.source.SourceUtil.getInputSource(
resolver.resolveURI(uri)
).getByteStream()
)
);

if you create a String from a byte stream, array or whatever is byte-based don't you have to specify the charset?

I will look into that.

AFAIK creating a String from a byte array
uses the platform default charset.

Which AFAIU is UTF-8 on MacOSX.

form.lookupWidget("xhtml").setValue(string);

did you check whether the string looks fine here?

...just what came up to my mind right away

var htmlWidget = form.lookupWidget("xhtml"); htmlWidget.setValue(getSourceAsString(id)); cocoon.log.info("String before edit: " + htmlWidget.getValue());

And it is correct at this stage.

regards Jeremy


--------------------------------------------------------

                  If email from this address is not signed
                                IT IS NOT FROM ME

                        Always check the label, folks !!!!!
--------------------------------------------------------


Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to