Jump to:

5540 Posts in 1738 Topics by 1224 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: 1048 Views
  • Entar
    Community Member
    19 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:


       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.

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.