| | |
| | | 'UNKNOWN' => 'ISO-8859-15', |
| | | 'USERDEFINED' => 'ISO-8859-15', |
| | | 'KSC56011987' => 'EUC-KR', |
| | | 'GB2312' => 'GBK', |
| | | 'GB231280' => 'GBK', |
| | | 'UNICODE' => 'UTF-8', |
| | | 'UTF7IMAP' => 'UTF7-IMAP', |
| | | 'TIS620' => 'WINDOWS-874', |
| | | 'ISO88599' => 'WINDOWS-1254', |
| | | 'ISO885911' => 'WINDOWS-874', |
| | | 'MACROMAN' => 'MACINTOSH', |
| | | 'GB2312' => 'GBK', |
| | | 'GB231280' => 'GBK', |
| | | 'UNICODE' => 'UTF-8', |
| | | 'UTF7IMAP' => 'UTF7-IMAP', |
| | | 'TIS620' => 'WINDOWS-874', |
| | | 'ISO88599' => 'WINDOWS-1254', |
| | | 'ISO885911' => 'WINDOWS-874', |
| | | 'MACROMAN' => 'MACINTOSH', |
| | | '77' => 'MAC', |
| | | '128' => 'SHIFT-JIS', |
| | | '129' => 'CP949', |
| | |
| | | * @param int Level of the error |
| | | * @param string Error message |
| | | */ |
| | | public function error_handler($errno, $errstr) |
| | | public static function error_handler($errno, $errstr) |
| | | { |
| | | throw new ErrorException($errstr, 0, $errno); |
| | | } |
| | |
| | | if ($from == 'UTF-8') { |
| | | // @TODO: we need a function for UTF-7 (RFC2152) conversion |
| | | if ($to == 'UTF7-IMAP' || $to == 'UTF-7') { |
| | | if ($_str = utf8_to_utf7imap($str)) { |
| | | if ($_str = self::utf8_to_utf7imap($str)) { |
| | | return $_str; |
| | | } |
| | | } |
| | |
| | | break; |
| | | } |
| | | |
| | | $ch .= $u7; |
| | | $ch .= $u7; |
| | | } |
| | | |
| | | if ($ch == '') { |
| | |
| | | } |
| | | else if ($ord >= 0xC0) { |
| | | if (strlen($seq) > 1) { |
| | | $out .= preg_match($regexp, $seq) ? $seq : ''; |
| | | $out .= preg_match($regexp, $seq) ? $seq : ''; |
| | | $seq = ''; |
| | | } |
| | | else if ($seq && ord($seq) < 0xC0) { |