Author Topic: PHP Warning: mb_convert_encoding()  (Read 6337 times)

Offline SViRU

  • Jr. Member
  • **
  • Posts: 20
PHP Warning: mb_convert_encoding()
« on: December 19, 2006, 03:37:33 PM »
PHP Warning: mb_convert_encoding() [function.mb-convert-encoding]: Illegal character encoding specified in /usr/local/www/apache22/webmail/program/include/main.inc on line 919

i have one the same error on 2 different linux servers - now i have SVN 414 but earlier error exist too

anyone have solution to fix this problem?

Offline humam

  • Newbie
  • *
  • Posts: 6
Re: PHP Warning: mb_convert_encoding()
« Reply #1 on: December 20, 2006, 06:21:46 PM »
Well I faced the same problem.
anyway it is not harmful since it is just warning ;)
This happens when roundcube try to convert unsupported charset using mbstring functions - for example windows-1256 charset-

For me I get rid of mbstring functions by commenting the lines
 
Code: [Select]
if ($MBSTRING)
  {
  $to = $to=="UTF-7" ? "UTF7-IMAP" : $to;
  $from = $from=="UTF-7" ? "UTF7-IMAP": $from;

  // return if convert succeeded
  if (($out = mb_convert_encoding($str, $to, $from)) != '')
   return $out;
  }

in the file /program/include/main.inc on line around 919
since most of my emails were encoding with windows-1256 charset
and depends completely on iconv converting function which will be the next in the code (make sure that your php is compiled with iconv support and the iconv module is installed ).

Maybe this is not the right way to solve the problem, but it works with me :)