Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: UTF-8 / XslCompiledTransform

From: Gina_Marano <ginalster@-----.--->
To: NULL
Date: 11/11/2008 5:03:00 PM
On Nov 11, 4:28=A0pm, Gina_Marano <ginals...@gmail.com> wrote:
> Good day all,
>
> This has been working for months until now. I finally get a foreign
> character and it blows up.
>
> <?xml version=3D"1.0" encoding=3D"UTF-8"?>
> ...
> <ship_to_city>santana de parna=EDba</ship_to_city>
> ...
>
> transformation code:
>
> XmlTextReader readerOrigContent =3D
> =A0 =A0 new XmlTextReader(new MemoryStream(UTF8Encoding.Default.GetBytes
> (sOrigXMLContent)));
> StringBuilder sbResult =3D new StringBuilder();
> StringWriter sResult =3D new StringWriter(sbResult);
> XmlTextWriter sXML =3D new XmlTextWriter(sResult);
>
> XslCompiledTransform myXslTransform =3D new XslCompiledTransform();
> myXslTransform.Load(aXSLFileName);
> myXslTransform.Transform(readerOrigContent, null, sXML);
> sXML.Flush();
> return sbResult.ToString();
>
> Any thought here?
>
> It blows up on myXslTransform.Transform(readerOrigContent, null,
> sXML);
>
> I believe the =ED is UTF-8
>
> Thanks much!
>
> ~Gina_M~

I changed this:
      new XmlTextReader(new MemoryStream(UTF8Encoding.Default.GetBytes
to:
      new XmlTextReader(new MemoryStream(ASCIIEncoding.UTF8.GetBytes
(sOrigXMLContent)));

A code review would be helpful if anyone has any thoughts on how I did
this. :)

Thanks

~Gina_M~


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent