How to add UTF-8 encoding to XML?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to add UTF-8 encoding to XML?

Raj-2
Hi



I am using the below code

StaxDriver driver = new StaxDriver();
  driver.getQnameMap().setDefaultNamespace
("http://xml.ms.com/ns/fx/eams");
   
    XStream xStream = new XStream(driver);
    xStream.setMode(XStream.NO_REFERENCES);


String xml = xStream.toXML(event);

the xml below is prints xml but encoding is missing.

How to add UTF-8 encoding to XML?

Regards
Rajan


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: How to add UTF-8 encoding to XML?

Jörg Schaible-4
Hello Rajan,

Raj wrote:

> Hi
>
>
>
> I am using the below code
>
> StaxDriver driver = new StaxDriver();
>  driver.getQnameMap().setDefaultNamespace
> ("http://xml.ms.com/ns/fx/eams");
>    
>    XStream xStream = new XStream(driver);
>     xStream.setMode(XStream.NO_REFERENCES);
>
>
> String xml = xStream.toXML(event);
>
> the xml below is prints xml but encoding is missing.
>
> How to add UTF-8 encoding to XML?

Please use the users list for such questions.

I also guess, you mean the XML declaration?

Cheers,
Jörg


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email