summaryrefslogtreecommitdiff
path: root/program/include
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2005-11-15 00:09:44 +0000
committerthomascube <thomas@roundcube.net>2005-11-15 00:09:44 +0000
commit0cbc094164c8a0fa3543e07105e06c129f679805 (patch)
treeccbca7054817662e294aaac0d9cd47057ae65263 /program/include
parentfd8c5061097f156da55a9cee8972aa4f13daa7b1 (diff)
SMTPS support and minor bugfixes
Diffstat (limited to 'program/include')
-rw-r--r--program/include/main.inc8
-rw-r--r--program/include/rcube_shared.inc8
2 files changed, 12 insertions, 4 deletions
diff --git a/program/include/main.inc b/program/include/main.inc
index 306d2105e..936cad388 100644
--- a/program/include/main.inc
+++ b/program/include/main.inc
@@ -261,16 +261,22 @@ function load_gui()
// set localization charset based on the given language
function rcmail_set_locale($lang)
{
- global $OUTPUT, $INSTLL_PATH;
+ global $OUTPUT, $INSTLL_PATH, $CHARSET;
static $rcube_charsets;
if (!$rcube_charsets)
@include($INSTLL_PATH.'program/localization/index.inc');
if (isset($rcube_charsets[$lang]))
+ {
$OUTPUT->set_charset($rcube_charsets[$lang]);
+ $CHARSET = $rcube_charsets[$lang];
+ }
else
+ {
$OUTPUT->set_charset('ISO-8859-1');
+ $CHARSET = 'ISO-8859-1';
+ }
}
diff --git a/program/include/rcube_shared.inc b/program/include/rcube_shared.inc
index 9b1b23bf6..8d26d56c4 100644
--- a/program/include/rcube_shared.inc
+++ b/program/include/rcube_shared.inc
@@ -1188,7 +1188,7 @@ function send_future_expire_header()
// replace specials characters to a specific encoding type
function rep_specialchars_output($str, $enctype='', $mode='', $newlines=TRUE)
{
- global $OUTPUT_TYPE;
+ global $OUTPUT_TYPE, $CHARSET;
static $html_encode_arr, $js_rep_table, $rtf_rep_table, $xml_rep_table;
if (!$enctype)
@@ -1208,7 +1208,7 @@ function rep_specialchars_output($str, $enctype='', $mode='', $newlines=TRUE)
{
if (!$html_encode_arr)
{
- $html_encode_arr = get_html_translation_table(HTML_SPECIALCHARS); // HTML_ENTITIES
+ $html_encode_arr = $CHARSET=='ISO-8859-1' ? get_html_translation_table(HTML_ENTITIES) : get_html_translation_table(HTML_SPECIALCHARS);
$html_encode_arr[chr(128)] = '&euro;';
unset($html_encode_arr['?']);
unset($html_encode_arr['&']);
@@ -1245,9 +1245,11 @@ 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);
- //$js_rep_table[Chr($c)] = sprintf("\u%s%s", str_repeat('0', 4-strlen($hex)), $hex);
$rtf_rep_table[Chr($c)] = "\\'$hex";
$xml_rep_table[Chr($c)] = "&#$c;";
+
+ if ($CHARSET=='ISO-8859-1')
+ $js_rep_table[Chr($c)] = sprintf("\u%s%s", str_repeat('0', 4-strlen($hex)), $hex);
}
$js_rep_table['"'] = sprintf("\u%s%s", str_repeat('0', 4-strlen(dechex(34))), dechex(34));