Author Topic: Russian users  (Read 4234 times)

Offline melco

  • Newbie
  • *
  • Posts: 1
Russian users
« on: September 12, 2006, 11:45:19 AM »
Hi. I'm using Russian UI and receiving CP-1251 and KOI8-R encoded messages.
I've added KOI8-R to unicode MAP and it's work perfect, but yesterday i received GB2312 encoded message and of course it wasn't correctly displayed by RoundCube.
I've decided to make RoundCube use iconv php extension.
I've patch RoundCube a little...

in utf8.class.php
OLD:
Code: [Select]
 //Translate string ($str) to UTF-8 from given charset
  function strToUtf8($str){
   $chars = unpack('C*', $str);
   $cnt = count($chars);
   for($i=1;$i<=$cnt;$i++) $this->_charToUtf8($chars[$i]);
   return implode(&quot;&quot;,$chars);
  }
NEW:
Code: [Select]
 //Translate string ($str) to UTF-8 from given charset
  function strToUtf8($str){
  return iconv($charset,"UTF-8",$str);
  }

And it's work perfectly. But when i try to add some contact with Russian letters from message to contacts then contact become corrupted...

It would be nice to use iconv widely in RoundCube

P.S. Sorry for my English :)