diff -ur roundcube.r955/config/main.inc.php.dist roundcube/config/main.inc.php.dist
|
old
|
new
|
|
| 120 | 120 | // the default locale setting |
| 121 | 121 | $rcmail_config['locale_string'] = 'en'; |
| 122 | 122 | |
| | 123 | // the default locale charset |
| | 124 | $rcmail_config['locale_charset'] = 'ISO-8859-1'; |
| | 125 | |
| 123 | 126 | // use this format for short date display |
| 124 | 127 | $rcmail_config['date_short'] = 'D H:i'; |
| 125 | 128 | |
diff -ur roundcube.r955/program/include/main.inc roundcube/program/include/main.inc
|
old
|
new
|
|
| 141 | 141 | include_once('config/db.inc.php'); |
| 142 | 142 | $conf = array_merge($conf, $rcmail_config); |
| 143 | 143 | |
| | 144 | if (empty($conf['locale_charset'])) |
| | 145 | $conf['locale_charset'] = 'ISO-8859-1'; |
| | 146 | |
| 144 | 147 | if (empty($conf['log_dir'])) |
| 145 | 148 | $conf['log_dir'] = $INSTALL_PATH.'logs'; |
| 146 | 149 | else |
diff -ur roundcube.r955/program/include/rcube_imap.inc roundcube/program/include/rcube_imap.inc
|
old
|
new
|
|
| 65 | 65 | var $search_string = ''; |
| 66 | 66 | var $search_charset = ''; |
| 67 | 67 | var $debug_level = 1; |
| | 68 | var $charset = ''; |
| 68 | 69 | var $error_code = 0; |
| 69 | 70 | |
| 70 | 71 | |
| … |
… |
|
| 78 | 79 | $this->db = $db_conn; |
| 79 | 80 | } |
| 80 | 81 | |
| | 82 | function setCharset($charset) { |
| | 83 | $this->charset = $charset; |
| | 84 | } |
| 81 | 85 | |
| 82 | 86 | /** |
| 83 | 87 | * PHP 4 object constructor |
| … |
… |
|
| 889 | 893 | $results = $this->_search_index($mailbox, $search); |
| 890 | 894 | |
| 891 | 895 | // try search with ISO charset (should be supported by server) |
| 892 | | if (empty($results) && !empty($charset) && $charset!='ISO-8859-1') |
| 893 | | $results = $this->search($mbox_name, $criteria, rcube_charset_convert($str, $charset, 'ISO-8859-1'), 'ISO-8859-1'); |
| | 896 | if (empty($results) && !empty($charset) && $charset!=$GLOBALS['CONFIG']['locale_charset']) |
| | 897 | $results = $this->search($mbox_name, $criteria, rcube_charset_convert($str, $charset, $GLOBALS['CONFIG']['locale_charset']), $GLOBALS['CONFIG']['locale_charset']); |
| 894 | 898 | |
| 895 | 899 | $this->set_search_set($criteria, $str, $results, $charset); |
| 896 | 900 | return $results; |
| … |
… |
|
| 1229 | 1233 | { |
| 1230 | 1234 | // assume ISO-8859-1 if no charset specified |
| 1231 | 1235 | if (empty($o_part->charset)) |
| 1232 | | $o_part->charset = 'ISO-8859-1'; |
| | 1236 | $o_part->charset = $GLOBALS['CONFIG']['locale_charset']; |
| 1233 | 1237 | |
| 1234 | 1238 | $body = rcube_charset_convert($body, $o_part->charset); |
| 1235 | 1239 | } |
| … |
… |
|
| 2279 | 2283 | */ |
| 2280 | 2284 | function decode_header($input, $remove_quotes=FALSE) |
| 2281 | 2285 | { |
| 2282 | | $str = $this->decode_mime_string((string)$input); |
| | 2286 | $str = $this->decode_mime_string((string)$input, !empty($this->charset) ? $this->charset : null ); |
| 2283 | 2287 | if ($str{0}=='"' && $remove_quotes) |
| 2284 | 2288 | $str = str_replace('"', '', $str); |
| 2285 | 2289 | |
| … |
… |
|
| 2318 | 2322 | } |
| 2319 | 2323 | |
| 2320 | 2324 | // no encoding information, use fallback |
| 2321 | | return rcube_charset_convert($input, !empty($fallback) ? $fallback : 'ISO-8859-1'); |
| | 2325 | return rcube_charset_convert($input, !empty($fallback) ? $fallback : $GLOBALS['CONFIG']['locale_charset'] ); |
| 2322 | 2326 | } |
| 2323 | 2327 | |
| 2324 | 2328 | |
| … |
… |
|
| 2396 | 2400 | return rcube_charset_convert($body, $ctype_param['charset']); |
| 2397 | 2401 | |
| 2398 | 2402 | // defaults to what is specified in the class header |
| 2399 | | return rcube_charset_convert($body, 'ISO-8859-1'); |
| | 2403 | return rcube_charset_convert($body, $GLOBALS['CONFIG']['locale_charset'] ); |
| 2400 | 2404 | } |
| 2401 | 2405 | |
| 2402 | 2406 | |
diff -ur roundcube.r955/program/lib/Mail/mime.php roundcube/program/lib/Mail/mime.php
|
old
|
new
|
|
| 182 | 182 | 'text_encoding' => '7bit', |
| 183 | 183 | 'html_encoding' => 'quoted-printable', |
| 184 | 184 | '7bit_wrap' => 998, |
| 185 | | 'html_charset' => 'ISO-8859-1', |
| 186 | | 'text_charset' => 'ISO-8859-1', |
| 187 | | 'head_charset' => 'ISO-8859-1' |
| | 185 | 'html_charset' => $GLOBALS['CONFIG']['locale_charset'], |
| | 186 | 'text_charset' => $GLOBALS['CONFIG']['locale_charset'], |
| | 187 | 'head_charset' => $GLOBALS['CONFIG']['locale_charset'] |
| 188 | 188 | ); |
| 189 | 189 | } |
| 190 | 190 | |
| … |
… |
|
| 527 | 527 | $params['encoding'] = $value['encoding']; |
| 528 | 528 | if ($value['disposition'] != "inline") { |
| 529 | 529 | $fname = array("fname" => $value['name']); |
| 530 | | $fname_enc = $this->_encodeHeaders($fname, array('head_charset' => $value['charset'] ? $value['charset'] : 'iso-8859-1')); |
| | 530 | $fname_enc = $this->_encodeHeaders($fname, array('head_charset' => $value['charset'] ? $value['charset'] : $GLOBALS['CONFIG']['locale_charset'])); |
| 531 | 531 | $params['dfilename'] = $fname_enc['fname']; |
| 532 | 532 | } |
| 533 | 533 | if ($value['charset']) { |
diff -ur roundcube.r955/program/lib/utf8.class.php roundcube/program/lib/utf8.class.php
|
old
|
new
|
|
| 38 | 38 | // Adapted to fit RoundCube |
| 39 | 39 | define("UTF8_MAP_DIR", "program/lib/encoding"); |
| 40 | 40 | $utf8_maps = array( |
| | 41 | "KOI8-R" => UTF8_MAP_DIR . "/KOI8R.map", |
| | 42 | "KOI8_R" => UTF8_MAP_DIR . "/KOI8R.map", |
| | 43 | "KOI8R" => UTF8_MAP_DIR . "/KOI8R.map", |
| 41 | 44 | "CP1250" => UTF8_MAP_DIR . "/CP1250.map", |
| 42 | 45 | "CP1251" => UTF8_MAP_DIR . "/CP1251.map", |
| 43 | 46 | "CP1252" => UTF8_MAP_DIR . "/CP1252.map", |
| … |
… |
|
| 64 | 67 | //Class definition |
| 65 | 68 | Class utf8{ |
| 66 | 69 | |
| 67 | | var $charset = "ISO-8859-1"; |
| | 70 | var $charset = ""; |
| 68 | 71 | var $ascMap = array(); |
| 69 | 72 | var $utfMap = array(); |
| 70 | 73 | |
| 71 | 74 | // made PHP5 capable by RoundCube |
| 72 | | function __construct($charset="ISO-8859-1"){ |
| 73 | | $this->loadCharset($charset); |
| | 75 | function __construct($charset=""){ |
| | 76 | $this->charset = $GLOBALS['CONFIG']['locale_charset']; |
| | 77 | if(empty($charset)) $charset = $this->charset; |
| | 78 | $this->loadCharset($charset); |
| 74 | 79 | } |
| 75 | 80 | |
| 76 | 81 | //Constructor |
| 77 | | function utf8($charset="ISO-8859-1"){ |
| | 82 | function utf8($charset=""){ |
| 78 | 83 | $this->__construct($charset); |
| 79 | 84 | } |
| 80 | 85 | |
diff -ur roundcube.r955/program/steps/mail/func.inc roundcube/program/steps/mail/func.inc
|
old
|
new
|
|
| 229 | 229 | |
| 230 | 230 | $out .= sprintf("<td class=\"icon\">%s</td>\n", $message_icon ? sprintf($image_tag, $skin_path, $message_icon, '') : ''); |
| 231 | 231 | |
| | 232 | $IMAP->setCharset($header->charset); |
| | 233 | |
| 232 | 234 | // format each col |
| 233 | 235 | foreach ($a_show_cols as $col) |
| 234 | 236 | { |
| … |
… |
|
| 317 | 319 | if (empty($header)) |
| 318 | 320 | continue; |
| 319 | 321 | |
| | 322 | $IMAP->setCharset($header->charset); |
| | 323 | |
| 320 | 324 | // format each col; similar as in rcmail_message_list() |
| 321 | 325 | foreach ($a_show_cols as $col) |
| 322 | 326 | { |
| … |
… |
|
| 815 | 819 | |
| 816 | 820 | $header_count = 0; |
| 817 | 821 | |
| | 822 | |
| | 823 | $IMAP->setCharset($headers['charset']); |
| | 824 | |
| 818 | 825 | // allow the following attributes to be added to the <table> tag |
| 819 | 826 | $attrib_str = create_attrib_string($attrib, array('style', 'class', 'id', 'cellpadding', 'cellspacing', 'border', 'summary')); |
| 820 | 827 | $out = '<table' . $attrib_str . ">\n"; |