PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Text » Text_Highlighter » Bug #5927

Umlauts break highlighting

Details

Submitted2005-11-10 18:09 UTC
Fromflack at contentcontrol-berlin dot de
StatusBogus
PackageText_Highlighter
PHP Version4.3.10
OSDebian
Roadmaps(Not assigned)

Comments

[2005-11-10 18:09 UTC] flack at contentcontrol-berlin dot de

Description:
------------
When I try to highlight a script which includes umlauts in
PHP Code (for example in a quoted String), Highlighting is
broken starting from the umlaut to the end of the
document.

As long as the umlauts are in the default region,
everything is fine, but once they are in a PHP region,
they are interpreted as two characters and many of the
subsequent cahracters are displayed incorrectly as well.

Test script:
---------------
$renderer =& new
Text_Highlighter_Renderer_HTML($options);
$hl =& Text_Highlighter::factory('php');
$hl->setRenderer($renderer);
echo $hl->highlight("ä"); //displayed correctly
echo $hl->highlight("<? 'ä'?>"); //not displayed
correctly

Expected result:
----------------
ä
<?'ä'?>

Actual result:
--------------
ä
<? 'ä''?>

[2005-11-24 05:50 UTC] blindman at php dot net

The code you supplied gets highlighted correctly, both ISO-8859-1 and UTF-8