Changeset 6088 in subversion
- Timestamp:
- Apr 15, 2012 4:51:54 AM (13 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/program/include/rcube_charset.php
r6085 r6088 94 94 * @return string The validated charset name 95 95 */ 96 public static function parse ($input)96 public static function parse_charset($input) 97 97 { 98 98 static $charsets = array(); … … 179 179 { 180 180 static $iconv_options = null; 181 static $mbstring_loaded = null;182 181 static $mbstring_list = null; 183 182 static $conv = null; 184 183 185 $to = empty($to) ? strtoupper(RCMAIL_CHARSET) : self::parse ($to);186 $from = self::parse ($from);184 $to = empty($to) ? strtoupper(RCMAIL_CHARSET) : self::parse_charset($to); 185 $from = self::parse_charset($from); 187 186 188 187 if ($from == $to || empty($str) || empty($from)) { … … 190 189 } 191 190 192 // convert charset using iconv module 193 if (function_exists('iconv') && $from != 'UTF7-IMAP' && $to != 'UTF7-IMAP') { 194 if ($iconv_options === null) { 191 if ($iconv_options === null) { 192 if (function_exists('iconv')) { 195 193 // ignore characters not available in output charset 196 194 $iconv_options = '//IGNORE'; … … 200 198 } 201 199 } 202 200 } 201 202 // convert charset using iconv module 203 if ($iconv_options !== null && $from != 'UTF7-IMAP' && $to != 'UTF7-IMAP') { 203 204 // throw an exception if iconv reports an illegal character in input 204 205 // it means that input string has been truncated … … 216 217 } 217 218 218 if ($mbstring_loaded === null) { 219 $mbstring_loaded = extension_loaded('mbstring'); 220 } 221 222 // convert charset using mbstring module 223 if ($mbstring_loaded) { 224 $aliases['WINDOWS-1257'] = 'ISO-8859-13'; 225 226 if ($mbstring_list === null) { 219 if ($mbstring_list === null) { 220 if (extension_loaded('mbstring')) { 227 221 $mbstring_list = mb_list_encodings(); 228 222 $mbstring_list = array_map('strtoupper', $mbstring_list); 229 223 } 224 } 225 226 // convert charset using mbstring module 227 if ($mbstring_list !== null) { 228 $aliases['WINDOWS-1257'] = 'ISO-8859-13'; 230 229 231 230 $mb_from = $aliases[$from] ? $aliases[$from] : $from;
Note: See TracChangeset
for help on using the changeset viewer.
