Re: problem with german special char 'ß' in wddx (expat r elated)!
| From: | thies at digicol dot de | Date: | Tue, 04 Apr 2000 15:22:01 +0000 |
| Subject: | Re: problem with german special char 'ß' in wddx (expat r elated)! | ||
| References: | 1 2 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-13092@lists.php.net to get a copy of this message | ||
On Tue, Apr 04, 2000 at 09:48:12AM -0500, Andrei Zmievski wrote:
> On Tue, 04 Apr 2000, Thies C . Arntzen wrote:
> >
> > hi andrei,
> >
> > script:
> >
> > <?php
> > $var = "kuß";
> > var_dump($var);
> > $packet = wddx_serialize_value($var);
> > var_dump($packet);
> > $unpacked = wddx_deserialize($packet);
> > var_dump($unpacked);
> > ?>
> >
> > produces:
> >
> > X-Powered-By: PHP/4.0RC2-dev
> > Content-type: text/html
> >
> > string(3) "kuß"
> > string(81) "<wddxPacket
> > version='1.0'><header/><data><string>kuß</string></data></wddxPacket>"
> > string(12) "kuß</string>"
> >
> > note the </string> ath the end of out deserialized variable!
> >
> > so it seems that german special char ß has a special meaning in
> > expat - but how should we treat it different?
>
> Yes, it does appear to be related to how expat handles it. I'm not sure
> what we'd want to do.
found the problem - encoding (ext/xml has some code to handle
this!)
using the php-expat interface works:
<?
error_reporting(-1);
$a = "<wddxPacket
version='1.0'><header/><data><string>kuß</string></data></wddxPacket>";
function cdata($parser, $value) {
echo "cdata $value\n";
}
function xstart($parser, $tgname, $attrs) {
//echo "xstart "; var_dump($parser, $tgname, $attrs);
}
function xend($parser, $tgname) {
//echo "xend "; var_dump($parser, $tgname);
}
$xml_parser = xml_parser_create();
xml_set_element_handler($xml_parser, "xstart", "xend");
xml_set_character_data_handler($xml_parser, "cdata");
xml_parse($xml_parser, $a);
?>
will you have a look at it or should i?
tc
>
> -Andrei
> * Unix is user friendly, it is just chooses its users selectively. *
>
--
Thies C. Arntzen "One Big-Mac, Small Fries and a Coke!"
Digital Collections Phone +49 40 235350 Fax +49 40 23535180
Hammerbrookstr. 93 20097 Hamburg / Germany