Hi,

i have changed two things in ext/mbstring:

1) i changed all structs to be const to prevent compiler warnings and 
programming errors.

2) i implemented a html encoding.

at this time i have input decoding simply as a pass by and output encoding 
that produces
named or numeric entities for html output. This way i can enforce the 
engine to deliver
entities in output.

At this point it only works with characters < 256. I guess the problem has 
something
to do with internal handling of characters > 255.

Anyone interested may download the patch: 
http://marcus.boerger.de/php/ext/mbstring/mbstring-entities-const.patch
And the additional file holding translation the table: 
http://marcus.boerger.de/php/ext/mbstring/html_entities.c

If the idea finds friends i will check this in and invent some more work in 
decoding and encoding.

Example script:
----------
<?php
         mb_http_input("ISO-8859-1");
         mb_internal_encoding("ISO-8859-1");
         mb_http_output("HTML");
         ob_start("mb_output_handler");
?><html>
<head>
<title>ext/mbstring HTML Encoding Test Page</title>
</head>
<body>
<?php echo chr(126).chr(127).chr(126).chr(0xE4).chr(0xF6).chr(0xFC);?>

<?php echo "&#126;&#127;&#126;&auml;&ouml;&uuml;";?>

</body>
</html>
----------

The above script will output the first php line just as the second one:
----------
&#126;&#127;&#126;&auml;&ouml;&uuml;
&#126;&#127;&#126;&auml;&ouml;&uuml;
----------

regards
marcus



------------------->>> mailto:[EMAIL PROTECTED] <<<------------------
"We are animals among animals, all children of matter,
save that we are the more disarmed. But since, unlike animals,
we know that we must die, let us prepare for that moment
by enjoying the life that has been given us by chance and for chance."
                                Umberto Eco, The island of the day before
--------------------->>> http://marcus-boerger.de <<<---------------------

Reply via email to