summaryrefslogtreecommitdiff
path: root/roundcubemail/program
diff options
context:
space:
mode:
authorthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2007-09-09 18:04:54 +0000
committerthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2007-09-09 18:04:54 +0000
commitc3bf4d795bba4dd5f2d2f4345a9b3f8268299efe (patch)
tree2c8394c98bf427bb6b5cc38c899fae0a433b457e /roundcubemail/program
parent33a8c85ad8859a0f50aed605251aa592241c9714 (diff)
Fixed charset encoding bug (#1484429)
git-svn-id: https://svn.roundcube.net/trunk@788 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program')
-rw-r--r--roundcubemail/program/include/main.inc7
1 files changed, 1 insertions, 6 deletions
diff --git a/roundcubemail/program/include/main.inc b/roundcubemail/program/include/main.inc
index 0d062039d..854458a64 100644
--- a/roundcubemail/program/include/main.inc
+++ b/roundcubemail/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;';