Re: R: [phpxmlrpc-devel] proper data encoding in string value
Brought to you by:
ggiunta
From: maHo <lu...@ma...> - 2003-06-09 11:40:02
|
> A little while ago I posted to the list a proposal (well, some > questions, rather than a patch, actually) for variable XML encoding.=20 > In short: some people might need UTF-8 and some people might need > iso-whatever. Moreover, using default encoding of UTF-8 is not in > accordance with RFC2616 (afaik), so we actually have a problem. (see > posting dated 25/9/02) >=20 > Instead of just reversing the $xmlrpc_defencoding var, a better > solution would be to make it a property of the client (or message ?) > class, so that it can be switched 'on the fly'. good idea, but builtin xml parser doesn't support encodings other that= =20 iso8859-1, so mentioned option won't help, but can be very confusing. but if default encoding is iso8859-1, and optional UTF8, then IMHO if=20 would be good solution. >=20 > On the other end of the tunnel, xmlrpc servers should be allowed to > decide which encoding they accept. The best option would be of course > if the server could accept more than one encoding, and maybe reply to > messages using the same encoding as received, 'guessing' it by > peering at 1-the HTTP headers, 2-the <?xml> tag. >=20 > I did not propose an implementation for the above because my > understanding of the xml syntax is too little for point 2 above. >=20 >=20 > As for not transalting stuff inside <string> except for '<' and '&', > you also have to make sure that you're 'translating' chars that are > not valid in the chosen encoding. conforming to XMLRPC-spec, translated chars don't need to be in choosen charset. and the fact is, that in iso-8859-1 all chars, even=20 binary data is encoded and decoded properly. I know that's a little tricky, but if xml parser doesn't behave=20 properly, this is IMHO a must. >=20 > One little note: php is quite limited in xml encodings supported > because of the underlying xml library (expat). Luckily the next > version (php 5) will use by default XML-lib, wich is much more > powerful/advanced in many ways. BTW. i heard that builtin xmlrpc functions, which are now in=20 experimental state, are quite powerful, so maybe phpxmlrpc will be=20 unneccesary in the future. regards maHo --=20 lukasz shift-2 mach.com.pl,http://www.lukasz.mach.com.pl=09 gg://1612670 jabber://ma...@ja... jabber://ma...@ja... icq://136281200 motto://"nie dziel skarbu p=F3ki smok zipie" |