Changeset 77e2322 in github
- Timestamp:
- Dec 16, 2008 8:40:13 AM (4 years ago)
- Branches:
- master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
- Children:
- b9f9f18
- Parents:
- dea237e
- File:
-
- 1 edited
-
program/include/main.inc (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
program/include/main.inc
r64c9b5b r77e2322 179 179 function rcube_charset_convert($str, $from, $to=NULL) 180 180 { 181 static $mbstring_loaded = null, $convert_warning = false; 181 static $mbstring_loaded = null; 182 static $mbstring_list = null; 183 static $convert_warning = false; 182 184 183 185 $from = strtoupper($from); … … 220 222 $aliases['WINDOWS-1257'] = 'ISO-8859-13'; 221 223 222 // return if convert succeeded 223 if (($out = mb_convert_encoding($str, ($aliases[$to] ? $aliases[$to] : $to), ($aliases[$from] ? $aliases[$from] : $from))) != '') 224 return $out; 224 if (is_null($mbstring_list)) { 225 $mbstring_list = mb_list_encodings(); 226 $mbstring_list = array_map('strtoupper', $mbstring_list); 227 } 228 229 $mb_from = $aliases[$from] ? $aliases[$from] : $from; 230 $mb_to = $aliases[$to] ? $aliases[$to] : $to; 231 232 // return if encoding found, string matches encoding and convert succeeded 233 if (in_array($mb_from, $mbstring_list) && in_array($mb_to, $mbstring_list)) 234 if (mb_check_encoding($str, $mb_from)) 235 if ($out = mb_convert_encoding($str, $mb_to, $mb_from)) 236 return $out; 225 237 } 226 238
Note: See TracChangeset
for help on using the changeset viewer.
