Jump to:

5452 Posts in 1673 Topics by 1197 members

Customising the CMS

SilverStripe Forums » Customising the CMS » [SOLUTION] little workaround for russian SS site

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 991 Views
  • Entar
    Avatar
    Community Member
    18 Posts

    [SOLUTION] little workaround for russian SS site Link to this post

    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.

    991 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.