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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Customising the CMS /

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

[SOLUTION] little workaround for russian SS site

Go to End



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:


	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.