Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Comments
Kim Togo 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 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 2-May-11 9:39am    
Okay, perhaps it is the web service that do not encoding it correct?

1 solution

Check your Encoding in XmlWriterSettings for the XmlWriter object.

XmlWriterSettings settings = new XmlWriterSettings();
settings.Encoding = Encoding.UTF8
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900