Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / XML / May 2004

Tip: Looking for answers? Try searching our database.

Encoding problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Greg - 25 May 2004 17:35 GMT
Hi all,

I'm using the XmlDocument class to create an XML document. I found out that
in .NET there are special classes that they do that job a lot faster,
namelly XmlTextWritter. My problem is that using the XmlTextWritter the
encoding gets messed up.

How do I set the XmlTextWritter's ecncoding to be the same as the one that
the XmlDocument is using?
I've tried this but doesn't work.

System.IO.MemoryStream s = new System.IO.MemoryStream();

XmlTextWriter LWriter = new XmlTextWriter(s, Encoding.Unicode);

Thanks in advance,
Greg
Dare Obasanjo [MSFT] - 26 May 2004 22:20 GMT
Your problem is not specific enough to provide you with any help. Are you
writing the XML to a MemoryStream and then loading the XmlDocument or
something else?

Signature

This posting is provided "AS IS" with no warranties, and confers no rights.

> Hi all,
>
[quoted text clipped - 13 lines]
> Thanks in advance,
> Greg
Greg - 27 May 2004 08:16 GMT
Hi Dare,

Here is the full picture. I use a component written in C# that builds HTML
pages dynamically and then sends the contents together with some headers
bandled up in a XML document (text only) to an ISAPI via COM. When it
reaches the ISAPI I set the headers and contents of the Response object form
the XML document and send it to the browser.

That XML document is the one that gives me trouble. When I use the
XmlDocument class to create it it works fine. But, when I use the
XmlTextWriter pages in the browser appear to contain some weird caracters.

Thanks,
Greg.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.