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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

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

[SOLUTION] little workaround for russian SS site


Go to End


1958 Views

Avatar
Entar

Community Member, 23 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.