[imp] multibyte charset bugs and iconv support hack in imp (3.1)

Viljo Viitanen vviitane+mail.imp@mappi.helsinki.fi
Sat Oct 26 11:50:17 2002


Me, last night:

> Multiple character set support with less than 15 lines added :) But I
> haven't checked what might have broken with these modifications.

Replying/forwarding, of course.

The same iconv magic needs to be added in (3.1, again) imp/compose.php,
before line 74 (return $data;):

ini_set('display_errors',0);
$conv=iconv(strtoupper($mime->charset),strtoupper($GLOBALS['registry']->getCharset()).'//TRANSLIT',$data);
ini_set('display_errors',1);
if ($conv != FALSE) {
  $data=$conv;
}

It would have been a good idea to make those lines a function, but this is
just a hack, not a proper implementation. Also, there seems to be a bug in
the header decoding routine (it fails sometimes), but I haven't dug into
that yet.

Also, in distant future, it might be a good idea to start to store all user
data in utf-8, and convert to whatever charset we're using on the fly.

(and now that I think about it, maybe I should have brought this up on the
horde list, not imp.)

-- 
Viljo Viitanen