-
Re: UTF-8 Zen-Cart Tutorial for v1.3.x
Hi everyone!
I was removing all the countries I did not need from the countries and changed Spain to Espaņa so everything would be in spanish on my sitea fter that started to get a question mark symbol for the Ņ character in the registration form drop-down.
So I followed this steps to solve it:
1. I inserted España in the database, which lead me to an error in the purchase confirmation email, it displayed the ñ when inserting the country, but solved the registration form issue.
2. I deleted Espaņa from the countries table and added it again after changing the encoding of countries_name database field, and inserted it again.
3. I tried changing the encoding of the field to utf8_spanish_ci
4. Changed the whole database to UTF-8 from COLLATE in phpMyAdmin
6. I´ve created the file my_db_charset.php in /includes/extra_configures and also in admin/includes/extra_configures
7. I downloaded the database to my pc and using UltraEdit I changed all instance of latin1 to utf8, and utf8_latin_ci to utf8_spanish_ci
The rest of special characters in my site are displayed correctly. None of the above helped me....
The site is www.touchtoys.es and I´m running ZenCart 1.3.9d with a template from zencart-template
I´m stating to go crazy due to this error, any ideas where I might messed up or what am I missing?
Thanks for everything!
-
Re: UTF-8 Zen-Cart Tutorial for v1.3.x
Quote:
6. I´ve created the file my_db_charset.php in /includes/extra_configures and also in admin/includes/extra_configures
How does Espaņa display in the country list in admin?
-
Re: UTF-8 Zen-Cart Tutorial for v1.3.x
THANK YOU VERY MUCH TORVISTA!!!
I checked it in the country list, which was displayed with the same odd character. So I changed it there and solved the problem!
I own you a couple of beers and some tapas!!!
-
Re: UTF-8 Zen-Cart Tutorial for v1.3.x
Point 6 was the key to ensure the character entered in admin got stored in the database as UTF-8.
You should delete or fix the accents on these two provinces too or you will not be able to check your validation.
[QUOTE
theForm.zone_id.options[2] = new Option("K�rnten", "99");
theForm.zone_id.options[1] = new Option("Baden W�rtemberg", "80");
[/QUOTE]
Nice site!
-
Re: UTF-8 Zen-Cart Tutorial for v1.3.x
I just left three countries since we do not want to expand worldwide just now ;-)
Do I have to chance that as well? and where do I change that lines?
Thanks again for everything!
-
Re: UTF-8 Zen-Cart Tutorial for v1.3.x
Hi, I'm looking for some advice regarding my tables.
I've converted my database as per the tutorial.
Now, when I create new tables in my databse, they use utf8_general_ci collation.
My existing tables (the ones created when I installed Zen Cart) are still showing latin1_swedish_ci.
Does this matter?
Should I convert the latin ones to utf8?
I tested converting 1 table from latin to utf8 and it doesn't seem to have broken anything but I did notice the columns in the table are still latin. I can convert the columns to utf-8 too if I need to.
I'd like to get everything to utf-8 but I don't know if doing it would break my cart?
Any advice would be appreciated guys
-
Re: UTF-8 Zen-Cart Tutorial for v1.3.x
As for the tables and the overall database, if you change those settings then it will ensure that new columns added to those tables or new tables added to that database will use the new character set.
Converting the columns is what's important for your data, but if you do that without protecting the data inside those columns, you'll end up with corrupted data.
I'm not sure which tutorial you're talking about. There are about 10 different ideas tossed around in this thread by various people, with varying degrees of accuracy.
-
Re: UTF-8 Zen-Cart Tutorial for v1.3.x
Thanks for the reply Dr Byte.
The tutorial I was referring to was the original one, in post #1.
I'm worried about corrupting data by converting tables so I may start by converting a couple of small tables and wait for a week or two and if there are no problems, do another couple of tables.
It will take a while but hopefully I won't screw anything up!
If you have any better ideas I'm all ears :)
Thanks again for your help
-
Re: UTF-8 Zen-Cart Tutorial for v1.3.x
The help here worked great for me.
I've installed v1.3.9h like two weeks ago, the tutorial worked great to get Spanish language running.
Two small notes: Database was allready utf8 collation; also, query_factory.php comes with some logic to assign tf8, so no need to make this change:
//BOF changed for utf-8
mysql_query('SET NAMES "utf8"', $this->link);
//EOF changed for utf-8.
*****************
Aside from that, to beginners like me I recommend making sure you work one language at a time, one file at a time -making a safe coopy of your original file-.
*****************
Finally, using View | Character Encoding to make sure you're encoding right from the start, was of great help to me.
Thank you so much !!
Carlos
-
Re: UTF-8 Zen-Cart Tutorial for v1.3.x
Using the latest version of Zen Cart having updated from a previous version I ahve added French, German and Spanish. All works well except Spanish. However using the my_DB_charset setting to utf8 the Spanish is working OK.
Is it possible to introduce an if statement to the PHP file my_db_charset to just use the utf8 setting for Spanish ???
Yes I am new to this :lookaroun
-
Re: UTF-8 Zen-Cart Tutorial for v1.3.x
Quote:
Originally Posted by
timtimd
Is it possible to introduce an if statement to the PHP file my_db_charset to just use the utf8 setting for Spanish ???
No, because it doesn't know the selected language until long after the database connection is established.
-
Re: UTF-8 Zen-Cart Tutorial for v1.3.x
Having my spanish pack in utf-8 seems to be causing more harm than good for new users.
I have looked for and failed to find a free text batch converter to create a 8859 version from the utf8 files. Can anyone help to do this as a one off?
I don't mind maintaining the two versions but I just don't have the time to create this.
-
Re: UTF-8 Zen-Cart Tutorial for v1.3.x
i have read & followed the tutorial at www.srw2d.com regarding UTF-8... however, i'm having a problem. even though i go in and set the utf8_general_ci in the database, after I install all the fields/tables are set to latin1_general_ci.
any ideas?
-
Re: UTF-8 Zen-Cart Tutorial for v1.3.x
Quote:
Originally Posted by
vinhbao
i have read & followed the tutorial at
www.srw2d.com regarding UTF-8... however, i'm having a problem. even though i go in and set the utf8_general_ci in the database, after I install all the fields/tables are set to latin1_general_ci.
any ideas?
PHP5
ZenCart 1.3.9h
I have same issue here. Also adding the my_db_charset.php files to the extra_confirgures folders in admin and the store results in blank store and admin pages, deleting the files restores the pages. The encoding of these pages is Shift JIS not the expected UTF-8.
Craig
-
Re: UTF-8 Zen-Cart Tutorial for v1.3.x
PHP5
Zen 1.3.9h
Upgrading from Zen 1.2 (Japanese)
Shaun Ward, thank you so much for your help. I installed the Japanese Zen Cart 1.3.02-|10n-jp-6 with unsatisfactory results as it is based on an older version.
I am editing admin/index.php file as per your instructions. I do not know PHP very well and unfortunately stumble a lot. After making the changes the site gives me an error statement;
Parse error: syntax error, unexpected $end in store/zc_admin/index.php on line 189
Br Craig
-
Re: UTF-8 Zen-Cart Tutorial for v1.3.x
Please note the Japanese Language Pack that Shaun made already has the correct admin/index.php and invoice.php files.
Sorry for the unnecessary post.
-
Re: UTF-8 Zen-Cart Tutorial for v1.3.x
Using 1.3.9h, changing from latin1_swedish to utf8_general
In addition to defining charset as indicated here:
http://www.zen-cart.com/forum/showthread.php?t=153582
This is the most functional script I have found for converting tables and table data:
PHP Code:
<?php
function MysqlError()
{
if (mysql_errno())
{
echo "<b>Mysql Error: " . mysql_error() . "</b>\n";
}
}
$username = "root";
$password = "";
$db = "database";
$host = "localhost";
$target_charset = "utf8";
$target_collate = "utf8_general_ci";
echo "<pre>";
$conn = mysql_connect($host, $username, $password);
mysql_select_db($db, $conn);
$tabs = array();
$res = mysql_query("SHOW TABLES");
MysqlError();
while (($row = mysql_fetch_row($res)) != null)
{
$tabs[] = $row[0];
}
// now, fix tables
foreach ($tabs as $tab)
{
$res = mysql_query("show index from {$tab}");
MysqlError();
$indicies = array();
while (($row = mysql_fetch_array($res)) != null)
{
if ($row[2] != "PRIMARY")
{
$indicies[] = array("name" => $row[2], "unique" => !($row[1] == "1"), "col" => $row[4]);
mysql_query("ALTER TABLE {$tab} DROP INDEX {$row[2]}");
MysqlError();
echo "Dropped index {$row[2]}. Unique: {$row[1]}\n";
}
}
$res = mysql_query("DESCRIBE {$tab}");
MysqlError();
while (($row = mysql_fetch_array($res)) != null)
{
$name = $row[0];
$type = $row[1];
$set = false;
if (preg_match("/^varchar\((\d+)\)$/i", $type, $mat))
{
$size = $mat[1];
mysql_query("ALTER TABLE {$tab} MODIFY {$name} VARBINARY({$size})");
MysqlError();
mysql_query("ALTER TABLE {$tab} MODIFY {$name} VARCHAR({$size}) CHARACTER SET {$target_charset}");
MysqlError();
$set = true;
echo "Altered field {$name} on {$tab} from type {$type}\n";
}
else if (!strcasecmp($type, "CHAR"))
{
mysql_query("ALTER TABLE {$tab} MODIFY {$name} BINARY(1)");
MysqlError();
mysql_query("ALTER TABLE {$tab} MODIFY {$name} VARCHAR(1) CHARACTER SET {$target_charset}");
MysqlError();
$set = true;
echo "Altered field {$name} on {$tab} from type {$type}\n";
}
else if (!strcasecmp($type, "TINYTEXT"))
{
mysql_query("ALTER TABLE {$tab} MODIFY {$name} TINYBLOB");
MysqlError();
mysql_query("ALTER TABLE {$tab} MODIFY {$name} TINYTEXT CHARACTER SET {$target_charset}");
MysqlError();
$set = true;
echo "Altered field {$name} on {$tab} from type {$type}\n";
}
else if (!strcasecmp($type, "MEDIUMTEXT"))
{
mysql_query("ALTER TABLE {$tab} MODIFY {$name} MEDIUMBLOB");
MysqlError();
mysql_query("ALTER TABLE {$tab} MODIFY {$name} MEDIUMTEXT CHARACTER SET {$target_charset}");
MysqlError();
$set = true;
echo "Altered field {$name} on {$tab} from type {$type}\n";
}
else if (!strcasecmp($type, "LONGTEXT"))
{
mysql_query("ALTER TABLE {$tab} MODIFY {$name} LONGBLOB");
MysqlError();
mysql_query("ALTER TABLE {$tab} MODIFY {$name} LONGTEXT CHARACTER SET {$target_charset}");
MysqlError();
$set = true;
echo "Altered field {$name} on {$tab} from type {$type}\n";
}
else if (!strcasecmp($type, "TEXT"))
{
mysql_query("ALTER TABLE {$tab} MODIFY {$name} BLOB");
MysqlError();
mysql_query("ALTER TABLE {$tab} MODIFY {$name} TEXT CHARACTER SET {$target_charset}");
MysqlError();
$set = true;
echo "Altered field {$name} on {$tab} from type {$type}\n";
}
if ($set)
mysql_query("ALTER TABLE {$tab} MODIFY {$name} COLLATE {$target_collate}");
}
// re-build indicies..
foreach ($indicies as $index)
{
if ($index["unique"])
{
mysql_query("CREATE UNIQUE INDEX {$index["name"]} ON {$tab} ({$index["col"]})");
MysqlError();
}
else
{
mysql_query("CREATE INDEX {$index["name"]} ON {$tab} ({$index["col"]})");
MysqlError();
}
echo "Created index {$index["name"]} on {$tab}. Unique: {$index["unique"]}\n";
}
// set default collate
mysql_query("ALTER TABLE {$tab} DEFAULT CHARACTER SET {$target_charset} COLLATE {$target_collate}");
}
// set database charset
mysql_query("ALTER DATABASE {$db} DEFAULT CHARACTER SET {$target_charset} COLLATE {$target_collate}");
mysql_close($conn);
echo "</pre>";
On my test database, it works almost flawlessly. However, I get a few errors. For example:
Quote:
Dropped index idx_status_group_zen. Unique: 1
Mysql Error: Can't DROP 'idx_status_group_zen'; check that column/key exists
Dropped index idx_status_group_zen. Unique: 1
Dropped index idx_expires_date_zen. Unique: 1
Dropped index idx_date_scheduled_zen. Unique: 1
Altered field banners_title on banners from type varchar(64)
Altered field banners_url on banners from type varchar(255)
Altered field banners_image on banners from type varchar(64)
Altered field banners_group on banners from type varchar(15)
Altered field banners_html_text on banners from type text
Created index idx_status_group_zen on banners. Unique:
Mysql Error: Duplicate key name 'idx_status_group_zen'
Created index idx_status_group_zen on banners. Unique:
Quote:
Dropped index idx_key_value_zen. Unique: 1
Mysql Error: Can't DROP 'idx_key_value_zen'; check that column/key exists
Dropped index idx_key_value_zen. Unique: 1
Dropped index idx_cfg_grp_id_zen. Unique: 1
Altered field configuration_title on configuration from type text
Altered field configuration_key on configuration from type varchar(255)
Altered field configuration_value on configuration from type mediumtext
Altered field configuration_description on configuration from type text
Altered field use_function on configuration from type text
Altered field set_function on configuration from type text
Created index unq_config_key_zen on configuration. Unique: 1
Created index idx_key_value_zen on configuration. Unique:
Mysql Error: BLOB/TEXT column 'configuration_value' used in key specification without a key length
Created index idx_key_value_zen on configuration. Unique:
Are these pre-existing errors or is there a problem with the script?
-
Re: UTF-8 Zen-Cart Tutorial for v1.3.x
Those are script errors. As written it's not capable of handling multi-key indexes nor partial-length indexes, hence the error messages you're seeing.
What's the source of that script? Where did you get it from? It appears as though its source is:
stackoverflow.com/questions/105572/a-script-to-change-all-tables-and-fields-to-the-utf-8-bin-collation-in-mysql
but I'm just wondering if you're citing another source.
-
Re: UTF-8 Zen-Cart Tutorial for v1.3.x
Yes Dr. Byte, that is exactly where it came from. Are you aware of a script that will handle all the indexes?
-
Re: UTF-8 Zen-Cart Tutorial for v1.3.x
I agree -- that script was probably the closest I've seen to reliably handling most of the steps involved in properly preserving data while converting character sets and collation to UTF8.
I've made some alterations to overcome several of the limitations I see in it, and contributed the result here:
http://www.zen-cart.com/index.php?ma...oducts_id=1937
NOTES:
MAKE A DATABASE BACKUP FIRST!
And take your store Down For Maintenance while converting.
Watch out for any warnings - they will be shown in bold. Every error should receive appropriate attention before putting your site back online.
Feedback welcome.
-
Re: UTF-8 Zen-Cart Tutorial for v1.3.x
Quote:
Originally Posted by
DrByte
I agree -- that script was probably the closest I've seen to reliably handling most of the steps involved in properly preserving data while converting character sets and collation to UTF8.
I've made some alterations to overcome several of the limitations I see in it, and contributed the result here:
http://www.zen-cart.com/index.php?ma...oducts_id=1937
Feedback welcome.
DrByte, your instruction said
Quote:
e) Update your Zen Cart configure.php settings to use UTF8 for DB_CHARSET
I do not see the option for this change in either the catalog or admin configure.php. Is this setting located somewhere else?
Thanks!
-
Re: UTF-8 Zen-Cart Tutorial for v1.3.x
Post 92, earlier in this thread, has a link to how to handle this in 1.3.9: http://www.zen-cart.com/forum/showthread.php?t=153582
-
Re: UTF-8 Zen-Cart Tutorial for v1.3.x
Quote:
Originally Posted by
DrByte
Thanks DrByte! Do I need to touch these two lines of code in english.php for both catalog or admin? Just curious.
PHP Code:
setlocale(LC_TIME, 'en_US.ISO_8859-1');
define('CHARSET', 'iso-8859-1');
-
Re: UTF-8 Zen-Cart Tutorial for v1.3.x
Hmmm ... ya, probably a good idea. :)
-
Re: UTF-8 Zen-Cart Tutorial for v1.3.x
Quote:
Originally Posted by
DrByte
Hmmm ... ya, probably a good idea. :)
Okay, this is getting more complicated than I thought. There are actually 8 files or so in Zen Cart that reference iso-8859-1 and I am not sure of only english.php files needs the changes or if I have to touch more files.
When you get a chance to give this some thought it will probably be a good idea to provide more information on the best way to approach this.
Originally, this was going to be my plan of attack.
1. run your script
2. create /includes/extra_configures/my_db_charset.php and /adminFOLDER/includes/extra_configures/my_db_charset.php
3 Add this code to the above two files:
PHP Code:
<?php define('DB_CHARSET', 'utf8');
Update english php file in the catalog and admin to:
change this line from
PHP Code:
setlocale(LC_TIME, 'en_US.ISO_8859-1');
to
PHP Code:
setlocale(LC_TIME, 'en_US.utf8');
change this line from
PHP Code:
define('CHARSET', 'iso-8859-1');
to
PHP Code:
define('CHARSET', 'utf-8');
Also, I am not sure what the difference between utf8 and utf-8 is just simply follow the instruction provided. A clarification between the two if any will help as well.
-
Re: UTF-8 Zen-Cart Tutorial for v1.3.x
Keep in mind that the script itself is only intended to deal with the *database* conversion.
You *are* doing this on a TEST site, right?
-
Re: UTF-8 Zen-Cart Tutorial for v1.3.x
If you're going to edit any language files, you need to be sure to save them encoded as UTF8-without-BOM. Otherwise you'll have a BOM header at the top of each file, which will cause you headaches with blank pages and Headers Already Sent errors.
DB_CHARSET would be 'utf8'
CHARSET in the language files would be 'UTF-8'
and LC_TIME would be 'en_US.utf8'
-
Re: UTF-8 Zen-Cart Tutorial for v1.3.x
The script worked flawlessly without any errors and it was done applied in production but I had like 4 different backup of the database.
Thanks and I am glad I didn't destroyed our site in the process of converting the DB to utf8. That was a very nifty script!
-
Re: UTF-8 Zen-Cart Tutorial for v1.3.x
-
Re: UTF-8 Zen-Cart Tutorial for v1.3.x
Just so I am perfectly clear, there's absolutely no reason to touch any of these files even after the database has been converted to utf-8?
CATALOG/nddbc.html
Line #4 : <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
ADMINFOLDER/alert_page.php
Line #22 : <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
includes/classes/class.phpmailer.php
Line #43 : var $CharSet = "iso-8859-1";
/includes/functions/functions_email.php
Line #171 : $mail->CharSet = (defined('CHARSET')) ? CHARSET : "iso-8859-1";
/includes/functions/functions_general.php
Line #1582 : if (function_exists('iconv')) $string = iconv("Windows-1252", "ISO-8859-1//IGNORE", $string);
/includes/templates/template_default/templates/tpl_zc_install_suggested_default.php
Line #19 : <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
-
Re: UTF-8 Zen-Cart Tutorial for v1.3.x
Correct.
Most of those files are standalone and don't need touching. The others only mention 8859 as a fallback if the rest of the system is sorely misconfigured.
-
Re: UTF-8 Zen-Cart Tutorial for v1.3.x
Quote:
Originally Posted by
DrByte
Correct.
Most of those files are standalone and don't need touching. The others only mention 8859 as a fallback if the rest of the system is sorely misconfigured.
Thank you for the clarification!
-
Re: UTF-8 Zen-Cart Tutorial for v1.3.x
Quote:
Originally Posted by
DrByte
I agree -- that script was probably the closest I've seen to reliably handling most of the steps involved in properly preserving data while converting character sets and collation to UTF8.
I've made some alterations to overcome several of the limitations I see in it, and contributed the result here:
http://www.zen-cart.com/index.php?ma...oducts_id=1937
NOTES:
MAKE A DATABASE BACKUP FIRST!
And take your store Down For Maintenance while converting.
Watch out for any warnings - they will be shown in bold. Every error should receive appropriate attention before putting your site back online.
Feedback welcome.
The script has been updated so that it now properly handles NULL and DEFAULT values. The original from which it was adapted didn't handle those, and simply used defaults, thus losing all NULL or DEFAULT value settings. If you've used the previous edition of this script, you will have lost those values from your database. You'll have to manually add them back by comparing *your* database structure with the original Zen Cart database structure.
-
Re: UTF-8 Zen-Cart Tutorial for v1.3.x
Quote:
Originally Posted by
DrByte
The script has been updated so that it now properly handles NULL and DEFAULT values. The original from which it was adapted didn't handle those, and simply used defaults, thus losing all NULL or DEFAULT value settings. If you've used the previous edition of this script, you will have lost those values from your database. You'll have to manually add them back by comparing *your* database structure with the original Zen Cart database structure.
Is it possible to rerun the updated script? Will that fix the NULL or DEFAULT values or the best approach simply to manually change the NULL and DEFAULT values in the database?
Thanks for updating the script.
-
Re: UTF-8 Zen-Cart Tutorial for v1.3.x
The script cannot fix the values it left off the last time you ran it. You'll have to fix them by hand. Sorry. There are lots :(
-
Re: UTF-8 Zen-Cart Tutorial for v1.3.x
Quote:
Originally Posted by
DrByte
The script cannot fix the values it left off the last time you ran it. You'll have to fix them by hand. Sorry. There are lots :(
Thanks DrByte! I know there are lots of them which is why I wanted to ask before fixing them. I will fix those and then post back something else I observed if it's not gone after fixing that.
Thanks again for your help on this.
-
Re: UTF-8 Zen-Cart Tutorial for v1.3.x
Hi
I have some problems with this, maybe someone can help?
I am still using ZC 1.3.8
I followed the instructions from srw2d.com (which is now in a pdf file)
Since I already have a large databse with thousands of customers i had to convert it.
What i did was backup my database first (using the drop command - actually my version of phpmyadmin just calls it the DROP command and does NOT MENTION DROP TABLE/VIEW/PROCEDURE/FUNCTION
I then use textwrangler to find and replace where it said latin1 and changed it to utf8 (exactly like that find"latin1" replace "utf8") what it said before was CHARSET=latin1 and it now says CHARSET=utf8
There were 99 replacements made which is the same number as there are tables in the database.. so it looks right
Then what i did was make a new database on the same server.. go to phpyadmin and change it to utf8 then drop my old (modified) database tables on top (i kept the old database incase i had to switch back)
I change both my admin configure and configure files with setting for new database
Then i made all the changes from srw2d.com and saved the modified files.
Site works.. i check in firefox in admin and main areas encoding is set to utf8 according to firefox
However in view source the HEADER says
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
So there is something wrong there?
I have searched the database iso-8859-1 does not appear anywhere.
I have searched the files using developers tool kit and found the following instances of it
/home/xxxx/public_html/nddbc.html
Line #4 : <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
------------------------
/home/xxxx/public_html/includes/classes/class.phpmailer.php
Line #43 : var $CharSet = "iso-8859-1";
--------------------------
/home/xxxx/public_html/includes/functions/functions_email.php
Line #163 : $mail->CharSet = (defined('CHARSET')) ? CHARSET : "iso-8859-1";
------------------------
/home/xxxx/public_html/includes/languages/pure_blue/english.php
Line #53 : define('CHARSET', 'iso-8859-1');
-----------------------
/home/xxxx/public_html/includes/templates/template_default/templates/tpl_zc_install_suggested_default.php
Line #19 : <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
What should i do? The character encoding shown in the header is not right?
At the moment i only have english characters on my website.
Thanks
-
Re: UTF-8 Zen-Cart Tutorial for v1.3.x
In the admin section header it is saying text/html; charset=utf-8">
Thats good
But im looking at one of my old orders.. which was placed before when the database was set to latin
It is in Thai script and in the area where customers can enter their special comments for order section the customer typed in Thai language. However it appears like this
in a string of acii character code symbols. .. i cant paste them in this forum because this webpage somehow translate them into Thai script as they should look on MY site!!
Obviously that is not Thai script. The point of this excersise was to get these Thai language orders showing in Thai script!
At the moment customers just see this gobeldygook before they submit their order (the stuff they entered in Thai language is turned into this ascii code stuff)
Ive tried putting some Thai text ดอกไม้ไทย on my index page
but it still displays as ⏔ā¸##ā¸āš„ā¸Ąāš‰āš„ā¸—ā¸ĸ
Any ideas?
Al
-
Re: UTF-8 Zen-Cart Tutorial for v1.3.x
Just to confirm in the database i entered utf8 and the files define('CHARSET', 'utf-8'); setlocale(LC_TIME, 'en_US.utf8'); etc
-
Re: UTF-8 Zen-Cart Tutorial for v1.3.x
You said your admin html shows utf-8, but your storefront does not.
Thus (assuming you're using english) you need to update your /includes/languages/english.php -- define CHARSET as utf-8
-
Re: UTF-8 Zen-Cart Tutorial for v1.3.x
I have a related problem... I added a second zen cart to our database after upgrading to 1.39. All good, except I had trouble getting the Collation set to utf8_general_ci for the new tables.
So I ran a sript that updated all of the tables to utf8_general_ci.
That worked, but now my 1st shopping cart, which always displayed Japanese properly, is displaying garbage characters.
However, when I go in to Admin and look at the source (e.g. Product Description) the Japanese is fine. So it's all still correctly in the datablase.
The encoding of the cart comes up as utf-8,
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="ja">
and
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />)
and no changes I can make via the browser make the Japanese not look like garbage.
But still, when I log in to the admin and try to edit the text, it's fine (real Japanese characters).
Finally, in the cart view, SOME Japanese is displaying correctly. It is the Japanese from the php files. So any boilerplate text from the files displays properly in the cart, and any database text displays properly in Admin, but it is trashed in the cart.
Sorry for describing that several different ways. It's not a problem I've seen before.
Thanks!
-
Re: UTF-8 Zen-Cart Tutorial for v1.3.x
I am trying the script on a development copy of my site which was unfortunately created as latin1_swedish_ci somehow. It was running along fine, but then threw a fatal error part-way through the process:
Fatal error: Maximum execution time of 30 seconds exceeded in C:\wamp\www\latin1-to-utf8-conversion.php on line 90
There were plenty of other tables converted fine before this so I'm thinking I just need to up the timeout.
Do you know where I can do this?
Thanks.
-
Re: UTF-8 Zen-Cart Tutorial for v1.3.x
I added this to the top of the script:
set_time_limit(300);
Execution took 135 seconds for me. Others might want to add the same before trying to run it against a zen db.
-
Re: UTF-8 Zen-Cart Tutorial for v1.3.x
Quote:
Originally Posted by
DrByte
You said your admin html shows utf-8, but your storefront does not.
Thus (assuming you're using english) you need to update your /includes/languages/english.php -- define CHARSET as utf-8
I was scratching my head for a while as to why my admin worked, but my storefront didn't... the above gave me a hint:
If you have a template over ride for your english.php, you need to edit THAT one also!
/includes/languages/<your_template>/english.php
Like, DOH!
-
Re: UTF-8 Zen-Cart Tutorial for v1.3.x
My client got this message:
1267 Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (latin1_general_ci,IMPLICIT) for operation 'locate'
in:
[SELECT c.customers_email_address as customers_email_address FROM customers as c LEFT JOIN configuration as q on LOCATE( c.customers_email_address, q.configuration_value) >= 1 WHERE configuration_key = 'NEWSONLY_SUBSCRIPTION_TEST_GROUP' ]
So I decided that just converting the database to a standard utf8 would be the answer.
I have never done this before but I ran into an immediate problem. Now I know it's first thing in the morning and I'm not totally awake yet but I swear I put in the correct database settings - I copied them from the configure file but the connection isn't made to the database.
Says it's using the correct database but then says using the correct user name and password yes but access denied.
Could any server settings prevent this from running? I don't see how but the site is on a new server and I did create the problem by using the configure tables from a new installation with the rest of the database from the old hosting.