Click here to Skip to main content
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 2: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 OriginalGriff 436
1 Maciej Los 249
2 BillWoodruff 199
3 /\jmot 180
4 Suraj Sahoo | Coding Passion 170
0 OriginalGriff 8,484
1 Sergey Alexandrovich Kryukov 7,407
2 DamithSL 5,639
3 Maciej Los 5,159
4 Manas Bhardwaj 4,986


Advertise | Privacy | Mobile
Web03 | 2.8.1411023.1 | Last Updated 30 Apr 2011
Copyright © CodeProject, 1999-2014
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