We were short for time and there were other interesting features to consider

Today I was building a mock of an ASP.NET Web Service for my current project, and I had some problems reading XML with spanish characters ('ñ' for example).
I tried changing the <globalization> tag of the Web.Config to use an international encoding but it didn't work.
I tried forcing the WS encoding from C# code, but it didn't work either...

After some digging, I found this "fantastic" explanation:

According to comment written by a member of the MS team there is no way to change ASMX encoding.

We decided not to do this feature for 3 reasons:
1. UTF-8 can represent all Unicode characters
2. The Xml spec requires that all Xml processors understand UTF-8
3. We were short for time and there were other interesting features to consider.

Cool, now I have one good excuse for the next time we're in a rush and we have to get something finished "for yesterday" :D

So, If you want to change the XML response encoding from a WS from UTF-8 to another encoding... forget doing it from .NET ;)

Comments?

Posted by Kartones on 2007-07-16