From 536cc6d82cbbb4116bcee4929c321ed34de1895a Mon Sep 17 00:00:00 2001 From: andi Date: Wed, 26 Jan 2005 21:26:03 +0100 Subject: geshi fix for UTF8 (sent to upstream) darcs-hash:20050126202603-9977f-1c43c02c1d584bcfa5a5df0bd438d1107b23a87c.gz --- inc/geshi.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/inc/geshi.php b/inc/geshi.php index c1231fb59..40be329c5 100644 --- a/inc/geshi.php +++ b/inc/geshi.php @@ -1467,7 +1467,13 @@ class GeSHi // Otherwise, convert it to HTML form elseif ( $STRING_OPEN != '' ) { - $char = htmlentities($char, ENT_COMPAT, $this->encoding); + if(strtolower($this->encoding) == 'utf-8'){ + //only escape <128 (we don't want to break multibyte chars) + if( ord($char) < 128 ) $char = htmlentities($char, ENT_COMPAT, $this->encoding); + }else{ + //encode everthing + $char = htmlentities($char, ENT_COMPAT, $this->encoding); + } } // Where are we adding this char? if ( !$COMMENT_MATCHED ) -- cgit v1.2.3