First time here? You are looking at the most recent posts. You may also want to check out older archives or the tag cloud. Please leave a comment, ask a question and consider subscribing to the latest posts via RSS. Thank you for visiting! (hide this)

November 2006 Blog Posts

Want to change the encoding for a webservice? You can't!

Probably you never had that need, but just in case you want to change the text encoding for a web service response, the one that is inside the XML declaration at the top, from UTF-8 to anything else... well... you cannot do it: that string is hard coded inside the web service runtime.

This post, "Encoding limitations in ASMX", has a comment written by a member of the MS team that worked on that feature:

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.
We found out later that in the real world #2 just isn't the case. If we'd known that we probably would have made a different decision.

The most interesting is the 3rd reason: "We were short for time"...

This is one of the many situation were some specification are not followed, and software must deal also with "wrong" behaviors..