[phpxmlrpc-devel] proper data encoding in string value
Brought to you by:
ggiunta
|
From: maHo <lu...@ma...> - 2003-06-08 00:40:36
|
there is a problem in encoding string value to xmlrpcval.
original code uses htmlentities, which converts chars>0x127
to &someentity; format. this format doesn't stand well
with php xml parser, and disaster is ready, if there is
a must to transfer some letters, ie. from polish alphabet.
solutions:
1)the xmlrpc spec says that only '<' and '&' characters
need to be translated to entities.
so strtr($body,array("<"=3D>"<,"&"=3D>"&")) instead of
htmlentities($body) is better IMHO.
2)changing default encoding from "UTF-8" to
"iso-8859-1" helps a lot. I don't know why, it's very strange, (as=20
strange is fact,that php provides only iso8859-1 and utf8 encodings)
but with mentioned changes, you can transfer all data, even binary,
as xmlrpc string.
i've posted the proper patch at
http://sourceforge.net/tracker/download.php?group_id=3D34455&atid=3D411=
302&file_id=3D52440&aid=3D750764
pozdrav
maHo
--=20
lukasz shift-2 mach.com.pl,http://www.lukasz.mach.com.pl=09
gg://1612670 jabber://maHo@jabberpl.org jabber://maHo@jabber.org
icq://136281200 motto://"nie dziel skarbu p=F3ki smok zipie"
|