Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Customising the CMS /

[SOLUTION] little workaround for russian SS site


Reply


1085 Views

Avatar
Entar

Community Member, 19 Posts

29 December 2008 at 3:21pm

I know that one solution for problem with Russian symbols not being inputted correctly to database exist, but here's more simpler way to handle this problem:

sapphire\core\model\MySqlDatabase.php

   public function __construct($parameters) {
      $this->dbConn = mysql_connect($parameters['server'], $parameters['username'], $parameters['password']);
      mysql_set_charset('utf8', $this->dbConn); //add this
      $this->active = mysql_select_db($parameters['database'], $this->dbConn);

Don't forget database/tables/columns in your db are utf8_general_ci if not - alter them BEFORE you add any text in Russian.

This fix work only with php5 (or mysqli module for php4). So use it only if your hosting provider can offer you php5 support.

Only one problem is - you need to add this line after every update of the code...

Good luck.