Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Кодировка в MySQL 4.1.* и MySQL 5.* (ветка 1.5.*)  (Read 7730 times)

0 Members and 1 Guest are viewing this topic.

Makc666

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1614
  • Русский (ISO-8859-1) - Russian - Русский (Windows)
    • Makc's home page

Пожалуйста, ознакомьтесь с темой
"Кодировка в MySQL 4.1.* и MySQL 5.* (ветка 1.4.*)"

Информация ниже является лишь дополнением к ветке 1.5.*



Полезные ссылки на английском:
  • http://dev.mysql.com/doc/refman/5.1/en/charset-mysql.html
    There is a convention for collation names: They start with the name of the character set with which they are associated, they usually include a language name, and they end with _ci (case insensitive), _cs (case sensitive), or _bin (binary).
« Last Edit: November 12, 2010, 10:52:54 am by Makc666 »
Logged

Makc666

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1614
  • Русский (ISO-8859-1) - Russian - Русский (Windows)
    • Makc's home page
Re: Кодировка в MySQL 4.1.* и MySQL 5.* (ветка 1.5.*)
« Reply #1 on: August 19, 2010, 12:07:12 am »

В файле functions.inc.php начиная с ревизии 7733, а другими словами начиная с версии 1.5.8 по моей просьбе добавлен следующий код:
Code: [Select]
   if ($CONFIG['dbcharset']) {
        mysql_query("SET NAMES '{$CONFIG['dbcharset']}'", $result);
    }

Это значит, что начиная с версии 1.5.8 в случае необходимости вам больше не нужно изменять файл:
../include/functions.inc.php

Достаточно открыть файл:
/include/config.php

и добавить туда строку вида, к примеру:
Code: [Select]
$CONFIG['dbcharset'] = 'utf8';или
Code: [Select]
$CONFIG['dbcharset'] = 'cp1251';


Более того, в ветке 1.5.* функция подключения к базе данных используется по всей галереи.

Другими словами - файл bridgemgr.php, а так же сами файлы настроек интеграции ../bridge/*.php, используют общую функцию function cpg_db_query, которая напрямую зависит от настройки указанной выше.
« Last Edit: August 20, 2010, 09:28:46 pm by Makc666 »
Logged
Pages: [1]   Go Up
 

Page created in 0.022 seconds with 18 queries.