ability to define DB_CHARSET in v1.3.9?
hello all
i see in the new version that :
Code:
Added ability to define DB_CHARSET to automatically trigger a mysql SET NAMES statement if needed for things like UTF8 support, preventing the need to edit the db class
so where should i define this???
Re: ability to define DB_CHARSET ?
Create a new file for it:
/includes/extra_configures/my_db_charset.php
Code:
<?php define('DB_CHARSET', 'your_charset_here');
Do the same with: /admin/includes/extra_configures/my_db_charset.php
NOTES:
- This is only applicable to v1.3.9x. It will NOT work in older versions, and is not applicable to the future versions after v1.5.0 since they will be utf8 already.
Re: ability to define DB_CHARSET ?
I had to add this line of code when I upgraded to php 5 [ZenCart 138 code doesn't set the encoding of the client connection, so when connecting to a MySQL 5 server, the server will return utf-8 encoded text.]
PHP Code:
the code added to includes/classes/db/mysql/query_factory.php line 36:
mysql_set_charset('latin1');
Should I keep this or go with the new code
PHP Code:
/includes/extra_configures/my_db_charset.php <?php define('DB_CHARSET', 'your_charset_here');
I plan to upgrade this week to 1.39a
Re: ability to define DB_CHARSET ?
Using the DB_CHARSET define replaces the need for editing query_factory.php, so you should remove your custom code from that file.
Re: ability to define DB_CHARSET ?
Re: ability to define DB_CHARSET ?
Re: ability to define DB_CHARSET ?
hello, can you please help me out, no matter what i try i keep running into error during install:
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(');]
i have created my_db_charset.php in /includes/extra_configures & in /admin/includes/extra_configures with the line:
Code:
<?php define('DB_CHARSET', 'utf8');
to no avail...
The server specs:
<LI id=li_server_version>Server version: 5.1.44-community<LI id=li_mysql_proto>Protocol version: 10
<LI id=li_select_mysql_charset>MySQL charset: UTF-8 Unicode (utf8)
<LI id=li_web_server_software>Apache/2.2.15 (Win32) PHP/5.3.2<LI id=li_mysql_client_version>MySQL client version: mysqlnd 5.0.7-dev - 091210 - $Revision: 294543 $<LI id=li_used_php_extension>PHP extension: mysql
The collation (not sure if it is related) is set to utf8_general_ci
This is a clean install on a new server and the default setting seems to be this utf8 setting. I am not the admin of this server and it isn't obvious to me where or how i could chang the character set to latin on the database itself.
The database is allready created for me, i can fill it with tables or drop the tables in it, but not alter the database itself.
Any input to resolve would be highly appreciated, thank you
Re: ability to define DB_CHARSET ?
Add it to the bottom of /zc_install/includes/installer_params.php ... and keep it in the other locations where you already have it, too.
Re: ability to define DB_CHARSET ?
Thank you for the input.
I added the line like so after the last line in that file:
Code:
define('STRICT_ERROR_REPORTING', false);
define('DB_CHARSET', 'utf8');
unfortunately, it results in the exact same error message.
anything else i can try to resolve?
Re: ability to define DB_CHARSET ?
You need to say 'latin1' instead of 'utf8'