drisate Posted February 12, 2009 Share Posted February 12, 2009 Thats weird i get undefined function: mb_list_encodings() but i cheked and i do have it installed ... this is my conf Multibyte String mbstring.detect_order: auto Multibyte String mbstring.encoding_translation: Off Multibyte String mbstring.func_overload: 0 Multibyte String mbstring.http_input: auto Multibyte String mbstring.http_output: SJIS Multibyte String mbstring.internal_encoding: EUC-JP Multibyte String mbstring.language: Japanese Multibyte String mbstring.substitute_character: none The code asking for this is function if_decode ( $string, $old = 'utf-8', $new = 'utf-8', $default = 'iso-8859-1' ){ $type = array_map ( 'strtolower', mb_list_encodings () ); $old = strtolower ( $old ); $new = strtolower ( $new ); $default = strtolower ( $default ); $keep = ''; $temp = imap_mime_header_decode ( $string ); $i = sizeof ( $temp ); for ( $j = 0; $j < $i; $j++ ){ $temp[$j]->charset = strtolower ( $temp[$j]->charset ); if ( $temp[$j]->charset == 'default' && $old == $new || $temp[$j]->charset == $new ){ $keep .= $temp[$j]->text; }else{ $keep .= mb_convert_encoding ( $temp[$j]->text, $new, ( in_array ( $temp[$j]->charset, $type ) ? $temp[$j]->charset : $default ) ); } return $keep; } } I am at php 4.4.7 Quote Link to comment Share on other sites More sharing options...
drisate Posted February 12, 2009 Author Share Posted February 12, 2009 mb_list_encodings (PHP 5) DOH >.< ! Any way i can work this out in PHP 4? Quote Link to comment Share on other sites More sharing options...
drisate Posted February 12, 2009 Author Share Posted February 12, 2009 Hmm this is what i did in case somebody else has this prob if (function_exists(mb_list_encodings)) { $list_encoding = mb_list_encodings(); } else { // I did not upgrade to PHP 5 ... see the hassel? $list_encoding = array("pass", "auto", "wchar", "byte2be", "byte2le", "byte4be", "byte4le", "BASE64", "UUENCODE", "HTML-ENTITIES", "Quoted-Printable", "7bit", "8bit", "UCS-4", "UCS-4BE", "UCS-4LE", "UCS-2", "UCS-2BE", "UCS-2LE", "UTF-32", "UTF-32BE", "UTF-32LE", "UTF-16", "UTF-16BE", "UTF-16LE", "UTF-8", "UTF-7", "UTF7-IMAP", "ASCII", "EUC-JP", "SJIS", "eucJP-win", "SJIS-win", "JIS", "ISO-2022-JP", "Windows-1252", "ISO-8859-1", "ISO-8859-2", "ISO-8859-3", "ISO-8859-4", "ISO-8859-5", "ISO-8859-6", "ISO-8859-7", "ISO-8859-8", "ISO-8859-9", "ISO-8859-10", "ISO-8859-13", "ISO-8859-14", "ISO-8859-15", "EUC-CN", "CP936", "HZ", "EUC-TW", "BIG-5", "EUC-KR", "UHC", "ISO-2022-KR", "Windows-1251", "CP866", "KOI8-R"); } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.