From dc58bc8458731c93f96da3c3c2c79b9e6afcbfc9 Mon Sep 17 00:00:00 2001 From: Gabriel Wicke Date: Fri, 7 May 2004 09:06:45 +0000 Subject: [PATCH] add encoding option --- includes/Parser.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/includes/Parser.php b/includes/Parser.php index ed67b7a08c..898faf0ffd 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -405,7 +405,19 @@ class Parser /* interface with html tidy, used if $wgUseTidy = true */ function tidy ( $text ) { global $wgTidyConf, $wgTidyBin, $wgTidyOpts; + global $wgInputEncoding, $wgOutputEncoding; $cleansource = ''; + switch(strtoupper($wgOutputEncoding)) { + case 'ISO-8859-1': + $wgTidyOpts .= ($wgInputEncoding == $wgOutputEncoding)? ' -latin1':' -raw'; + break; + case 'UTF-8': + $wgTidyOpts .= ($wgInputEncoding == $wgOutputEncoding)? ' -utf8':' -raw'; + break; + default: + $wgTidyOpts .= ' -raw'; + } + $text = ''. 'test'.$text.''; -- 2.20.1