Re: Special characters messed up in ZC Admin
Yeah, I'm using phpmyadmin already -- that's how i have been creating the databases, etc. I'm using phpMyAdmin 2.6.4-pl4, and MySQL 4.1.18-standard.
When I create a database, I can set the collation -- I've tried both latin1_danish_ci and utf8_danish_ci with it set appropriately in the zen cart files. But, ALSO, on the right hand side of phpmyadmin, there's a few more settings: I can set the "language" (currently en-utf-8) and the "mySQL connection collation" (currently set to utf8_danish_ci). Both of these can be set by me. However, a third setting : "MySQL charset" can not be changed by me and it's currently set to UTF-8 Unicode (utf8). These are all the settings I see on this page, and I've tried many different combinations to no avail.
Further, I noticed that when I create a new database with a collation, let's say latin1_danish_ci, then export my current database, fix all the weird characters and change all the references to latin1_danish_ci in a text editor, then import that sql file into the new database, it looks okay. But, then if I immediately export to a text file, the sql file has the characters all screwed up again! HOWEVER, if I export the file WITHOUT SAVING A FILE -- just opening it on the screen -- it's fine! This could be an unrelated quirk of mySQL or phpmyadmin, I don't know...
I went through my php info and extracted all lines that had something to do with language, charsets, collations, etc.... I'll list them below. Maybe it'll shed some light on what's going on? Thanks so far, Chris...
Apache Environment
------------------
HTTP_ACCEPT_LANGUAGE en-us
HTTP_REFERER http://MYSITE.COM/pma/main.php?lang=...utf8_danish_ci
HTTP_COOKIE pma_theme=original; pma_collation_connection=utf8_danish_ci; pma_lang=en-utf-8; pma_charset=iso-8859-1
QUERY_STRING lang=en-utf-8&server=1&collation_connection=utf8_danish_ci
REQUEST_URI /pma/phpinfo.php?lang=en-utf-8&server=1&collation_connection=utf8_danish_ci
HTTP HEADERS INFORMATION
------------------------
Referer http://MYSITE.COM/pma/main.php?lang=...utf8_danish_ci
Accept-Language en-us
Cookie pma_theme=original; pma_collation_connection=utf8_danish_ci; pma_lang=en-utf-8; pma_charset=iso-8859-1
Content-Type text/html; charset=UTF-8
PHP Variables
-------------
_REQUEST["collation_connection"] utf8_danish_ci
_REQUEST["pma_collation_connection"] utf8_danish_ci
_REQUEST["pma_collation_connection"] utf8_danish_ci
_REQUEST["pma_lang"] en-utf-8
_REQUEST["pma_charset"] iso-8859-1
_GET["lang"] en-utf-8
_GET["collation_connection"] utf8_danish_ci
_COOKIE["pma_collation_connection"] utf8_danish_ci
_COOKIE["pma_lang"] en-utf-8
_COOKIE["pma_charset"] iso-8859-1
_SERVER["HTTP_REFERER"] http://MYSITE.COM/pma/main.php?lang=...utf8_danish_ci
_SERVER["HTTP_ACCEPT_LANGUAGE"] en-us
_SERVER["HTTP_COOKIE"] pma_theme=original; pma_collation_connection=utf8_danish_ci; pma_lang=en-utf-8; pma_charset=iso-8859-1
_SERVER["QUERY_STRING"] lang=en-utf-8&server=1&collation_connection=utf8_danish_ci
_SERVER["REQUEST_URI"] /pma/phpinfo.php?lang=en-utf-8&server=1&collation_connection=utf8_danish_ci
_SERVER["argv"] Array([0] => lang=en-utf-8&server=1&collation_connection=utf8_danish_ci)
Re: Special characters messed up in ZC Admin
I feel your pain - I had similar issues with a db-driven spanish site...
I'm running out of suggestions, but if you could export a couple of entries with the problem into a sql file, i'd be happy to take a look at it and see if I can reproduce/fix the problem...
I'll PM you my email addr.
Chris
Re: Special characters messed up in ZC Admin
Further testing this issue, I just installed a fresh 1.3.0.1 cart, separate from my real one. Chose latin1_danish_ci for the database collation and MySQL connection collation. (Of course, the MySQL charset was set to UTF-8 Unicode, because I can't change that setting)
I manually added one product with danish characters through the admin - and it shows up wrong in the database and on the website.
It must be a problem with the server or my php version or mysql version or who knows! I'd appreciate it if someone from the zen cart team could chime in here. Because I suspect this is a compatibility issue and it's already pushed us way off schedule.
Chris, thanks again -- i'll contact you by email...
Re: Special characters messed up in ZC Admin
Hi,
Is it possible for you to post a full phpinfo for your site. If you do not want to do this publically, then please pm me or drbyte.
I'm also looking at the possibility this may be an mbstring problem.
Re: Special characters messed up in ZC Admin
BTW wher in admin are you entering this value Tilbehør,
Is it as a product name, a category name or something else. ??
Re: Special characters messed up in ZC Admin
Just the results of my initial fiddlings
Initially I was having problems where admin worked fine with Tilbehør, used as a ategory name. It would display OK in admin, and I could repeatedly edit/save it without any problems.
However it always dislplayed incorrectly in Catalog.
I set character encoding in catalog and admin english.php to UTF-8 and everything works fine.
Note this is a default mysql5 install using the detalt latin1_swedish collation
Re: Special characters messed up in ZC Admin
Okay, I finally got my webhost to clear up the mbstring problem. It's installed and I thought this would finally solve the problem for us. But, it didn't.
After resolving mbstring -- I exported the database AGAIN, fixed the errors in Win32Pad, imported into a new database with latin1_danish_ci. Tried both iso-8859-1 and utf-8 in the language files, and the EXACT SAME PROBLEM.
I'm going to send another PM to wilt and dr. byte right now -- giving you guys full access to our system. I'm about two days away from throwing in the towel and looking into organized crime as a career option. It is %¤#%¤&@$ crazy how many hours I have wasted from my life trying to investigate this, and not even moving one small step toward solving it.
Re: Special characters messed up in ZC Admin
The man of the hour is Wilt! He fixed it up all nice and easy.
For anybody having this kind of problem in the future, it was because our server was somehow overriding the charset set by Zen Cart.
In our case, it was solved by adding one line to admin/includes/init_includes/init_sessions.php.
Find:
Code:
if (!defined('IS_ADMIN_FLAG')) {
die('Illegal Access');
}
Add this line under it:
Code:
header("Content-Type: text/html;charset=ISO-8859-1");
Re: Special characters messed up in ZC Admin
Just want to say, that this represents a bug in zen-cart.
The problem is this, Zen cart does send out correct html and sets in both admin and catalog
meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
or whatever the charset maybe.
The problem is that Apache also sends out headers setting the charset and if these are different to the html charset, your browser will listen to apache and not ZC.
We do already send override headers in the catalog, but forgot to put them in admin. :(
Needless to say, thye will be there in the next release. (albeit, in a different file than you mentioned above)
However, glad to have helped :)
Re: Special characters messed up in ZC Admin
I am having a similar problem.
I just moved a store from one host to another and now my spanish special characters aren't displaying correctly in the admin and catalog.