Re: Reading UTF-8 Data from XML file
- From: "Matt Hollingworth" <MattHollingworth@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 1 Jun 2005 06:06:14 -0700
"Matt Hollingworth" wrote:
>
>
> "Joerg Jooss" wrote:
>
> > Matt Hollingworth wrote:
> >
> > > Joerg,
> > >
> > > Thanks - A developer wrote this question...
> > >
> > > We currently have a StringWriter object t
> hat reads this in and
> > > > > transforms against an XslTransform object.
> > >
> > > Sorry - this means that the result of a transformation of an
> > > XmlDocument object is written to a string writer to clarify.
> > >
> > >
> > > My Webform does use uft-8 response and request encoding and I have
> > > tried using several other different encoding types to get it to work.
> > >
> > > I can get chinese charachters to display but some of the content is
> > > still broken, could the fact that my transformation results in a
> > > mixture of html code + english text + chinese text be part of the
> > > problem?
> >
> > Only if you were not using Unicode. But since you use UTF-8 as response
> > encoding, and assuming you don't mistreat any string objects in your
> > code, that should not be a problem.
> >
> > > It seems I get something like "藛鈥犆b偓鈥?/P>" notice the
> > > question mark and half a </p> tag.
> >
> > What characters are missing in this string? Is it only the opening '<'?
> >
> > Cheers,
> > --
> > http://www.joergjooss.de
> > mailto:news-reply@xxxxxxxxxxxxx
> >
>
> Yes - although if i disable output escaping in my xsl i can see that ?lt; is
> in the code as if the & has been replaced with a ?
>
>
> Here is the code for your ref:
> XmlDocument oDoc = new XmlDocument();
> XslTransform oXsl = new XslTransform();
>
> oDoc.Load(Server.MapPath(""));
> oXsl.Load(Server.MapPath("xsl/x_language_test.xsl"));
>
> StringWriter oSw = new StringWriter();
>
> oXsl.Transform(oDoc,null,oSw);
>
> litTestText.Text = oSw.ToString();
>
>
> Thanks
> Matt
having further investigated, i forgot to say that i only see what i do by
changing the encoding to simplified chinese in the browser, if i choose utf8
it is all still encoded like it appears in notepad if you click view source.
i did the same page in asp and it all displays correctly without issue.
>
>
.
- References:
- Re: Reading UTF-8 Data from XML file
- From: Matt Hollingworth
- Re: Reading UTF-8 Data from XML file
- Prev by Date: File Download from Network Share
- Next by Date: RE: Uploading Mulitiple Files with HTMLInputFile Control
- Previous by thread: Re: Reading UTF-8 Data from XML file
- Next by thread: Re: Reading UTF-8 Data from XML file
- Index(es):
Relevant Pages
|