Post by JNeuhoff » Sat Jul 04, 2009 6:19 pm

The Cyrillic charset is not correcly supported in Opencart.

E.g. when I enter 'Крилл' in the name, meta_description or description fields on the product edit page, they always end up as '?????' in the MySQL database.

Suggested bugfix: Make sure Opencart uses a proper UTF-8 connection.

Update file /system/database/mysql.php as follows in the constructor method:

Code: Select all

	public function __construct($hostname, $username, $password, $database) {
		if (!$this->connection = mysql_connect($hostname, $username, $password)) {
      		exit('Error: Could not make a database connection using ' . $username . '@' . $hostname);
    	}

    	if (!mysql_select_db($database, $this->connection)) {
      		exit('Error: Could not connect to database ' . $database);
    	}
		
		mysql_query("SET NAMES 'utf8'", $this->connection);
		mysql_query("SET CHARACTER SET utf8", $this->connection);
		mysql_query("SET character_set_connection=utf8;", $this->connection);

  	}

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by alexdaydreaming » Thu Jul 09, 2009 10:58 am

Hi JNeuhoff,

Thank you so much for your solution, this is the one I have been waiting for long time :D It also works for inputting Chinese in OC 1.2.8 O0

Thank you!!!
Alex

New member

Posts

Joined
Thu May 14, 2009 10:33 am

Post by JNeuhoff » Thu Jul 09, 2009 5:14 pm

So now you are making big money with your Opencart store like this guy :)

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by alexdaydreaming » Thu Jul 09, 2009 6:01 pm

I hope so! At least, I have learnt something newO0

New member

Posts

Joined
Thu May 14, 2009 10:33 am
Who is online

Users browsing this forum: No registered users and 66 guests