Vuoi cambiare encoding per un WebService? Non si può

Probabilmente non vi è mai capito di doverlo fare, ma se volete cambiare l'encoding del risultato di un webservice, quello che si trova nella dichiarazione dell'XML, da UTF-8 a qualcos'altro... non lo potete fare: sembra che si quella stringa sia "hardcoded" nel generatore di webservice.

Questo post, "Encoding limitations in ASMX", riporta un commento di uno sviluppatore del team MS che ha lavorato a questo:

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.

Interessante la 3a spiegazione "We were short for time" ...

Un'altro caso dove le specifiche non sono rispettate, e bisogna sviluppare sw che gestisce anche le cose non a specifica.

powered by IMHO 1.3

posted @ lunedì 12 giugno 2006 18:54

Print
Comments have been closed on this topic.
«aprile»
domlunmarmergiovensab
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011