|KOI8-R/WIN-1258 support [message #31058]
||Wed, 29 March 2006 03:38
There are at least two Cyrillic encodings: koi8-r (Unix) and win-1251 (Windows).
Historically preconceived, that we use koi8 in mail and Usenet and win for web.
In this case there are some problems: first, "msg" file in thm/default/i18n/russian is in koi8-r. I must recode it to win manually after every upgrade. Problem can be solved by making two translations in i18n: russian-koi (for some Unix fans Wink) and russian-win. You can recode texts using "convert_cyr_string($var,'k','w')" php function.
Second problem is with Newsgroup Manager. By leaving "as is" nntp.php just doesn't work with messages with Cyrillic spells. The problem is in "apply_custom_replace($text)" in include/theme/default/replace.inc file. nntp.php just returns an error. I don't remember what exactly it says, but after next upgrade I'll send you an error message.
Using barbarian method "delete anything than doesn't work" I have changed apply_custom_replace($text) to:
if ( !($arr = make_replace_array()) ) return convert_cyr_string($text,'k','w');
I just don't know, what this function does, but everything works with this terrible interference. Now there is no error message in replace.inc and I can read all messages in win in my forum.
Again and again thank you for the best forum I ever saw.
P.S.: sorry for bad English.