Click here to Skip to main content
11,577,710 members (64,295 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#2.0 C# WebService
My web service returns DataTable having string values with special character likes "å", "ä", and "ö"

So Its throwing an error "There is an error in XML document"

I search on net found that I need to work around serialization
But I am not getting exactly

Another solution I found, is replace special character

If you have any help link regarding this highly appreciated

Thanks
Posted 30-Apr-11 1:28am
Khaniya4.2K
Comments
Kim Togo at 30-Apr-11 7:51am
   
Are use using DataTable.WriteXml method? - This should not give you any problems for special characters. Just remember to use the right encoding class: UTF-8
Khaniya at 30-Apr-11 22:36pm
   
No I am calling web service which return DataTable
I am try to call like
DataTable tbl= WS.GetRecord();

where it gives mention error
thanks
Kim Togo at 2-May-11 9:39am
   
Okay, perhaps it is the web service that do not encoding it correct?

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Check your Encoding in XmlWriterSettings for the XmlWriter object.

XmlWriterSettings settings = new XmlWriterSettings();
settings.Encoding = Encoding.UTF8
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Peter Leow 180
1 DamithSL 170
2 Richard MacCutchan 125
3 OriginalGriff 115
4 Abhinav S 100
0 OriginalGriff 830
1 Sergey Alexandrovich Kryukov 701
2 Abhinav S 573
3 F-ES Sitecore 420
4 Dave Kreskowiak 374


Advertise | Privacy | Mobile
Web04 | 2.8.150603.1 | Last Updated 30 Apr 2011
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100