[Cartoweb-users] problems with CartoWeb in Russian
igev
igev at mail.ru
Thu Oct 26 04:27:41 EDT 2006
Hi!
I'm developing CW application and want to have
Russian interface along with English etc.
Some things are already working:
- strings in cyrillic (CP1251) in shapefiles (comments to objects)
are seen correctly in query listing.
For this purpose I have wrote this add-on to Encoder class (file Encoder.php):
/*****************************************/
class EncoderCP1251 implements EncoderInterface {
public function encode($text) {
if (is_array($text)) {
$result = array();
foreach ($text as $key => $value) {
$result[iconv('cp1251','utf-8',$key)] = iconv('cp1251','utf-8',$value);
}
return $result;
}
return iconv('cp1251','utf-8',$text);
}
/**
* @see EncoderInterface::decode()
*/
public function decode($text) {
if (is_array($text)) {
$result = array();
foreach ($text as $key => $value) {
$result[iconv('utf-8','cp1251',$key)] = iconv('utf-8','cp1251',$value);
}
return $result;
}
return iconv('utf-8','cp1251',$text);
}
/**
* @see EncoderInterface::getCharset()
*/
public function getCharset() {
return 'cp1251';
}
}
/*****************************************/
But when I've tried to translate interface (via Gettext,po,mo etc)
- all works ("mo"-file is ready and correct), interface is "translated",
and russian words are written in cyrillic letters, but are not readable -
as like CW had made conversion in another russian codepage.
Now I still can't understand why so.
Anybody can help me? Maybe, someone who deal with codepages
other than ISO-8859-1.
Thanks!
Sincerely, Igor Evdokimov.
More information about the Cartoweb-users
mailing list