summaryrefslogtreecommitdiff
path: root/program/include
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2007-09-09 18:04:54 +0000
committerthomascube <thomas@roundcube.net>2007-09-09 18:04:54 +0000
commit74ae8849ddffd90172a5f62cbc32469463473eb8 (patch)
tree71a0290e42a2d406a4070b505ac5c2281e0dbffa /program/include
parent03b27176ef522cdf1cfbe44d426592ab86932781 (diff)
Fixed charset encoding bug (#1484429)
Diffstat (limited to 'program/include')
-rw-r--r--program/include/main.inc7
1 files changed, 1 insertions, 6 deletions
diff --git a/program/include/main.inc b/program/include/main.inc
index 0d062039d..854458a64 100644
--- a/program/include/main.inc
+++ b/program/include/main.inc
@@ -1123,10 +1123,6 @@ function rep_specialchars_output($str, $enctype='', $mode='', $newlines=TRUE)
if (!$enctype)
$enctype = $GLOBALS['OUTPUT_TYPE'];
- // convert nbsps back to normal spaces if not html
- if ($enctype!='html')
- $str = str_replace(chr(160), ' ', $str);
-
// encode for plaintext
if ($enctype=='text')
return str_replace("\r\n", "\n", $mode=='remove' ? strip_tags($str) : $str);
@@ -1171,11 +1167,10 @@ function rep_specialchars_output($str, $enctype='', $mode='', $newlines=TRUE)
for ($c=160; $c<256; $c++) // can be increased to support more charsets
{
- $hex = dechex($c);
$xml_rep_table[Chr($c)] = "&#$c;";
if ($OUTPUT->get_charset()=='ISO-8859-1')
- $js_rep_table[Chr($c)] = sprintf("\u%s%s", str_repeat('0', 4-strlen($hex)), $hex);
+ $js_rep_table[Chr($c)] = sprintf("\\u%04x", $c);
}
$xml_rep_table['"'] = '&quot;';