Connecting Tech Pros Worldwide Forums | Help | Site Map

XML PI

Maersa
Guest
 
Posts: n/a
#1: Nov 12 '05
Hi All,

I'm using the XmlSchema class to generated my schemas, but I noticed that
the PI is always <?xml version="1.0" encoding="Windows-1252"?>.

Want to change the encoding to "utf-8"...
appreciate your help.

thanks,



Oleg Tkachenko
Guest
 
Posts: n/a
#2: Nov 12 '05

re: XML PI


Maersa wrote:
[color=blue]
> I'm using the XmlSchema class to generated my schemas, but I noticed that
> the PI is always <?xml version="1.0" encoding="Windows-1252"?>.
>
> Want to change the encoding to "utf-8"...
> appreciate your help.[/color]

First of all that's not PI, but xml declaration.
And in which encoding the schema is saved depends on how are you saving
it. E.g.
XmlSchema schema = new XmlSchema();
....
StreamWriter sw = new StreamWriter("foo.xsd", false, Encoding.UTF8);
schema.Write(sw);
sw.Close();

saves schema in utf-8 encoding.
--
Oleg Tkachenko
XML Insider
http://www.tkachenko.com/blog

Closed Thread


Similar .NET Framework bytes