Hi,
Just tried to install 1.3.9b on a local server which uses MySQL 5.1 with a default charset of
UTF-8 Unicode (utf8)
I'm disappointed to find that Zen Cart 1.3.9b isn't UTF-8 compatible.
The following error occurs when trying to install the software on a "modern" UTF-8 MySQL setup:
Code:
1366 Incorrect string value: '\xA3:&eur...' for column 'configuration_value' at row 1
in:
[INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Convert currencies for Text emails', 'CURRENCIES_TRANSLATIONS', '£,£:€,€', 'What currency conversions do you need for Text emails?
Default = £,£:€,€', 12, 120, NULL, '2003-11-21 00:00:00', NULL, 'zen_cfg_textarea_small(');]
Of course I understand that Zen Cart has to support lots of users on old servers but I hope that 2.0.0 will be UTF compatible... I'd suggest that a quick check at the installation stage for the correct character set to use in database connections would be a worthwhile inclusion.
If anyone wants to install Zen Cart 1.3.9b on a server that uses the UTF-8 character set as its default character set you'll need to modify
includes/classes/db/mysql/query_factory.php
Just after (line 38):
$this->link = @mysql_connect($zf_host, $zf_user, $zf_password, true);
put in the lines:
if (version_compare(mysql_get_server_info(), '4.1.0', '>=')) {
mysql_query('SET NAMES "latin1"', $this->link);
}
Of course, set the character set to whichever character set you'd like to use.
I've created a database using the latin1 character set then added the lines above to set the connection to MySQL to use "latin1" so that latin1 is used instead of the server's default of UTF-8. If this isn't done the SQL error mentioned above occurs, messing up the installation.
If you are still using a UTF-8 MySQL character set you'd use "utf8" as the character set in the line above.
Hope that helps anyone else who has the same problems!
All the best..
Conor
Bookmarks