diff options
Diffstat (limited to 'inc')
-rw-r--r-- | inc/geshi.php | 8 |
1 files changed, 7 insertions, 1 deletions
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 ) |