projects
/
squirrelmail.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
$default_charset variable equal to user's locale when decoding messages.
[squirrelmail.git]
/
functions
/
i18n.php
diff --git
a/functions/i18n.php
b/functions/i18n.php
index ff02b5d68222b793a04e499ac16e0e6503d43688..25e9f8862ab01309e627afc0b43f6455907c922c 100644
(file)
--- a/
functions/i18n.php
+++ b/
functions/i18n.php
@@
-29,6
+29,8
@@
function charset_decode ($charset, $string) {
$charset = strtolower($charset);
$charset = strtolower($charset);
+ set_my_charset() ;
+
if (ereg('iso-8859-([[:digit:]]+)', $charset, $res)) {
if ($res[1] == '1') {
$ret = charset_decode_iso_8859_1 ($string);
if (ereg('iso-8859-([[:digit:]]+)', $charset, $res)) {
if ($res[1] == '1') {
$ret = charset_decode_iso_8859_1 ($string);
@@
-36,6
+38,8
@@
function charset_decode ($charset, $string) {
$ret = charset_decode_iso_8859_2 ($string);
} else if ($res[1] == '4') {
$ret = charset_decode_iso_8859_4 ($string);
$ret = charset_decode_iso_8859_2 ($string);
} else if ($res[1] == '4') {
$ret = charset_decode_iso_8859_4 ($string);
+ } else if ($res[1] == '5') {
+ $ret = charset_decode_iso_8859_5 ($string);
} else if ($res[1] == '7') {
$ret = charset_decode_iso_8859_7 ($string);
} else if ($res[1] == '9') {
} else if ($res[1] == '7') {
$ret = charset_decode_iso_8859_7 ($string);
} else if ($res[1] == '9') {
@@
-422,12
+426,10
@@
function charset_decode_iso_8859_2 ($string) {
*/
function charset_decode_iso_8859_4 ($string) {
*/
function charset_decode_iso_8859_4 ($string) {
- global $default_charset
, $languages, $sm_notAlias
;
+ global $default_charset;
if (strtolower($default_charset) == 'iso-8859-4')
return $string;
if (strtolower($default_charset) == 'iso-8859-4')
return $string;
- if (strtolower($languages[$sm_notAlias]['CHARSET']) == 'iso-8859-4')
- return $string;
/* Only do the slow convert if there are 8-bit characters */
if (! ereg("[\200-\377]", $string))
/* Only do the slow convert if there are 8-bit characters */
if (! ereg("[\200-\377]", $string))
@@
-553,12
+555,10
@@
function charset_decode_iso_8859_7 ($string) {
ISOIEC 8859-9:1999 Latin Alphabet No. 5
*/
function charset_decode_iso_8859_9 ($string) {
ISOIEC 8859-9:1999 Latin Alphabet No. 5
*/
function charset_decode_iso_8859_9 ($string) {
- global $default_charset
, $languages, $sm_notAlias
;
+ global $default_charset;
if (strtolower($default_charset) == 'iso-8859-9')
return $string;
if (strtolower($default_charset) == 'iso-8859-9')
return $string;
- if (strtolower($languages[$sm_notAlias]['CHARSET']) == 'iso-8859-9')
- return $string;
/* Only do the slow convert if there are 8-bit characters */
if (! ereg("[\200-\377]", $string))
/* Only do the slow convert if there are 8-bit characters */
if (! ereg("[\200-\377]", $string))
@@
-586,12
+586,10
@@
function charset_decode_iso_8859_9 ($string) {
ISO/IEC 8859-13:1998 Latin Alphabet No. 7 (Baltic Rim)
*/
function charset_decode_iso_8859_13 ($string) {
ISO/IEC 8859-13:1998 Latin Alphabet No. 7 (Baltic Rim)
*/
function charset_decode_iso_8859_13 ($string) {
- global $default_charset
, $languages, $sm_notAlias
;
+ global $default_charset;
if (strtolower($default_charset) == 'iso-8859-13')
return $string;
if (strtolower($default_charset) == 'iso-8859-13')
return $string;
- if (strtolower($languages[$sm_notAlias]['CHARSET']) == 'iso-8859-13')
- return $string;
/* Only do the slow convert if there are 8-bit characters */
if (! ereg("[\200-\377]", $string))
/* Only do the slow convert if there are 8-bit characters */
if (! ereg("[\200-\377]", $string))
@@
-877,12
+875,10
@@
function charset_decode_koi8r ($string) {
windows-1254 (Turks)
*/
function charset_decode_windows_1254 ($string) {
windows-1254 (Turks)
*/
function charset_decode_windows_1254 ($string) {
- global $default_charset
, $languages, $sm_notAlias
;
+ global $default_charset;
if (strtolower($default_charset) == 'windows-1254')
return $string;
if (strtolower($default_charset) == 'windows-1254')
return $string;
- if (strtolower($languages[$sm_notAlias]['CHARSET']) == 'windows-1254')
- return $string;
/* Only do the slow convert if there are 8-bit characters */
if (! ereg("[\200-\377]", $string))
/* Only do the slow convert if there are 8-bit characters */
if (! ereg("[\200-\377]", $string))
@@
-959,9
+955,9
@@
function charset_decode_windows_1254 ($string) {
windows-1253 (Greek)
*/
function charset_decode_windows_1253 ($string) {
windows-1253 (Greek)
*/
function charset_decode_windows_1253 ($string) {
- global $
languages, $sm_notAlias
;
+ global $
default_charset
;
- if (strtolower($
languages[$sm_notAlias]['CHARSET']
) == 'windows-1253')
+ if (strtolower($
default_charset
) == 'windows-1253')
return $string;
/* Only do the slow convert if there are 8-bit characters */
return $string;
/* Only do the slow convert if there are 8-bit characters */
@@
-1006,12
+1002,10
@@
function charset_decode_windows_1253 ($string) {
windows-1257 (BaltRim)
*/
function charset_decode_windows_1257 ($string) {
windows-1257 (BaltRim)
*/
function charset_decode_windows_1257 ($string) {
- global $default_charset
, $languages, $sm_notAlias
;
+ global $default_charset;
if (strtolower($default_charset) == 'windows-1257')
return $string;
if (strtolower($default_charset) == 'windows-1257')
return $string;
- if (strtolower($languages[$sm_notAlias]['CHARSET']) == 'windows-1257')
- return $string;
/* Only do the slow convert if there are 8-bit characters */
if (! ereg("[\200-\377]", $string))
/* Only do the slow convert if there are 8-bit characters */
if (! ereg("[\200-\377]", $string))
@@
-1175,11
+1169,11
@@
function set_my_charset(){
* selection. This is "more right" (tm), than just stamping the
* message blindly with the system-wide $default_charset.
*/
* selection. This is "more right" (tm), than just stamping the
* message blindly with the system-wide $default_charset.
*/
- global $data_dir, $username, $default_charset, $languages;
+ global $data_dir, $username, $default_charset, $languages
, $squirrelmail_default_language
;
$my_language = getPref($data_dir, $username, 'language');
if (!$my_language) {
$my_language = getPref($data_dir, $username, 'language');
if (!$my_language) {
-
return
;
+
$my_language = $squirrelmail_default_language
;
}
while (isset($languages[$my_language]['ALIAS'])) {
$my_language = $languages[$my_language]['ALIAS'];
}
while (isset($languages[$my_language]['ALIAS'])) {
$my_language = $languages[$my_language]['ALIAS'];