Topic: MySQL 5.0 & non-latin encoding

I have MySQL 5.0 server, and a database which uses cp1251_general_ci collation.

All the data are in cp1251.

PunBB is using Russian as default language, encoding in lang/Russian/common.php is set to windows-1251.

Everything is ok with the language pack, but the messages that are written in russian language, all appear as "???????? ??? ?????"

I have already known such issue, and I decided to add the following line to
lang/Russian/common.php ( after having changed $lang_common['lang_encoding'] to "CP1251"):

$db->query('SET NAMES '.$lang_common['lang_encoding']);

However, I think I just haven't found an easier way to solve this problem.