[SoapRMI] setting the encoding

Aleksander Slominski aslom_at_cs.indiana.edu
Wed, 03 Jul 2002 16:44:25 -0400


Patrick Peck wrote:

>
> hello,
>
> using the XmlRecorder in xpp2, how can i produce the xml header
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
>
> and have the recorder actually use the specified encoding?

hi,

you will need to write directly bytes representing XML prologue
into output stream  (<?xml version="1.0" encoding="ISO-8859-1"?>)
and then set the wrapped stream with encoding as output for recorder:

    XmlRecorder.setOutput(new OutputStreamWsriter(outStream, "ISO-8859-1"));

let me know you have problems with it.

alek

ps. we are working now on XmlSerializer for XMLPULL (XPP3)
and it will have nice and simple API to do this that you could
use to call serializer.startDocument("ISO-8859-1");
- should be available in next release of XPP3 so stay tuned :-)