Hi !

 

I’m using Dom4j to build Xml object in memory and then use the textual XML representation given by the asXml() method to send it over HTTP.

My problem is when I add a text node to the object, the string of which contains characters with accents, I get weird characters in the textual XML.

My guess is there is an encoding issue here.

 

Is it required to specify encoding somewhere (I want to use UTF-8) ? In the Text node itself maybe ?

Or do I need to encode the text before creating the text node ?

 

Example :

Bâtiment becomes bâtiment

(yes, this is French)

 

I’m using dom4j 1.5rc1 and the addText() method of the Node Interface.

 

thanks

Reply via email to