Ticket #1484565: roundcube-iconv-fix.patch
| File roundcube-iconv-fix.patch, 1.0 kB (added by memoryhole, 14 months ago) |
|---|
-
include/main.inc
1062 1062 if ($from==$to || $str=='' || empty($from)) 1063 1063 return $str; 1064 1064 1065 // These make up for most common mis-labellings noted in the wild, and are 1066 // harmless 1067 if ($from == 'X-UNKNOWN' || $from == 'UNKNOWN-8BIT' || $from == 'X-USER-DEFINED' || $from == 'ISO-8859-1' || $from == 'US-ASCII') 1068 $from = 'WINDOWS-1252'; 1069 if ($from == 'ISO-8859-8-I') $from = 'ISO-8859-8'; 1070 if ($from == 'GB2312') $from = 'GB18030'; 1071 1065 1072 // convert charset using iconv module 1066 1073 if (function_exists('iconv') && $from != 'UTF-7' && $to != 'UTF-7') 1067 return iconv($from, $to . "//IGNORE", $str); 1074 { 1075 $retstr = iconv($from, $to . "//IGNORE", $str); 1076 if (!$retstr) { 1077 return iconv('US-ASCII', $to . "//IGNORE", $str); 1078 } 1079 return $retstr; 1080 } 1068 1081 1069 1082 // convert charset using mbstring module 1070 1083 if ($MBSTRING)
