Jump to content

[SOLVED] undefined function: mb_list_encodings()


drisate

Recommended Posts

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

Link to comment
Share on other sites

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");
}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.