Re: entity changes

Julian Bond <[email protected]>
Newsgroups gmane.comp.php.xml-rpc
Message-ID <[email protected]>
Jeff Barr <[email protected]> wrote:
>Ok, that makes sense. I did some digging and it looks like the offending
>code is:
>                        case $xmlrpcString:
>                                 $rs.="<${typ}>" . htmlentities($val).
>"</${typ}>";
>                                 break;
>
>In xmlrpcval::serializeData. Do I simply need to write a function to replace
>htmlentities? It would basically do what htmlspecialchars does,
>and then translate everything that's non-ASCII into numeric entities. This
>should not be too hard to do with strtr.

Just saw this come flying in the inbox. This issue is a major PITA when 
generating RSS with PHP as well. htmlentities() uses the old html entity 
table not any of the new-fangled XML entity tables. And underlying this 
is a whole rant about the sense or nonsense of encoding the payload into 
XML in order to use an XML envelope and distribution protocol, whether 
it's RSS, XMLRPC or SOAP (or REST, heh!).

If you do write an xmlentities() function do please release it and tell 
us all. It would come in handy in lots of situations.

-- 
Julian Bond Email&MSM: [email protected]
Webmaster:              http://www.ecademy.com/
Personal WebLog:       http://www.voidstar.com/
M: +44 (0)77 5907 2173   T: +44 (0)192 0412 433
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.