stragami Posted November 12, 2013 Posted November 12, 2013 Hi, i have a porblem, with german special character like ö ä ü Ö Ä Ü ß if a customer open a new account using e.h. ä in field name the letter will be stored in database like: 㤠the field in admin shows like this � also in shop the will be � displeaed if i change this in admin the character ä will be stored as ä display io shop and admin = ä so the problem is that the shopfrondedn willstore the character like ä incorrect what i need to change so that also the shopfrontend will save this character popper?
MrPhil Posted November 12, 2013 Posted November 12, 2013 You have accented (non-ASCII) characters UTF-8 in some cases and Latin-1 in others. If an ä entered by the customer shows up as 㤠in some cases, it sounds like the table (or just the field) is Latin-1 while the page input was in UTF-8. If you have a single-byte Latin-1 ä in the database and the page is displayed in UTF-8, you will get a �. How did you convert your store from Latin-1 to UTF-8? Your database needs to be UTF-8 for all text fields (existing Latin-1 data will be converted to UTF-8). Your language support files need to be all UTF-8, including any setlocale() calls. Your pages need to be displayed in UTF-8. If you just changed a few fields or settings here and there, you won't properly be in UTF-8. It sounds like some pages are being displayed in UTF-8 and others in Latin-1, and your text going into the database is UTF-8 in some cases and Latin-1 in others.
stragami Posted November 12, 2013 Author Posted November 12, 2013 This Problem came up when i change the webspace - so think that can be a server problem - the same shop by a other hosting company the shop works fine i did not convert the databse - it shows MyISAM latin1_swedish_ci - to convert all entry in a databse this is no problem - problem is that the shop speak different "lanuages" and i dont know how i can tell te shop to wirte and read and display the same :-) i add define('CHARSET', 'iso-8859-1'); define('CHARSET', 'utf-8'); to both german.php but this not helps
stragami Posted November 12, 2013 Author Posted November 12, 2013 ok what i found is all what in keyin by admin side will be display inn shop and adminside fine - all öäü ect will be displayed correct but all what came from frondend like create account goes bad so there must be a bug in frondend but where?
MrPhil Posted November 12, 2013 Posted November 12, 2013 i add define('CHARSET', 'iso-8859-1'); define('CHARSET', 'utf-8'); to both german.php but this not helps What??! You add one or the other, but not both, and they should be the same in all cases. You don't change your store to UTF-8 simply by changing that one entry... you also have to change the database from its default of Latin-1 to UTF-8, and you have to have the proper (UTF-8) language files. Now, again, how exactly did you convert your store to UTF-8? "swedish" in the database character set is the collation (sort order) for special cases of accented and non-ASCII characters. If you're using Latin-1 for German text, it's safe to leave it as Swedish collation, or you can change to German collation (almost the same). In either case, the encoding is Latin-1.
stragami Posted November 13, 2013 Author Posted November 13, 2013 why the dadabse was on Swedish i dont know. ok i change the databse all tables to utf8_unicode_ci but i have the same problem i also try with setup in german.php define('CHARSET', 'iso-8859-1'); or define('CHARSET', 'utf-8'); and from german forum i add in includes/function/database.php if ($$link) mysql_select_db($database); return $$link; } to if ($$link) mysql_select_db($database); mysql_query("SET CHARACTER SET 'utf8'"); return $$link; } but this all did not help Let me explain: if i keyin datas in admin side like customer name or categorie or products and all others (with ö, ä ü) all will be dispalyed in adminside and shopside fine the only one ist if the customer keyin ö ä or ü in e.g. edit customer this goes wrong what is to do to make the wriitng into the databse from shopside correct thx
MrPhil Posted November 13, 2013 Posted November 13, 2013 It's "swedish" collation because MySQL was first developed in Sweden. That's still the default. What you're really concerned about is the encoding, which is Latin-1 (ISO-8859-1) by default, but you want UTF-8. The "define CHARSET" must be UTF-8, for your pages to be displayed in UTF-8 (which is presumably what you want). Don't put the SET CHARACTER SET 'utf8' in the database function. It will spend time checking for non-UTF-8 tables and fields every time you put up a page. You have to manually check all tables and text/char fields that they are UTF-8 (same collation, too). Your language files need to all be UTF-8 too (including English). Your language files should set the CHARSET to UTF-8. Once this is all done, all new text coming in to the store will be in UTF-8. Existing Latin-1 text will be converted to UTF-8 if the field was Latin-1. Existing Latin-1 text in a field that is already UTF-8 will not be converted automatically, and will probably result in a ?-in-black-diamond and you will need to manually edit it. Any UTF-8 data in a Latin-1 field, when the field is converted to UTF-8, will be treated as a series of Latin-1 characters and converted into a series of UTF-8 characters. They will have to be manually cleaned up.
stragami Posted November 13, 2013 Author Posted November 13, 2013 the problem must be in shop side (frondend) ...if i keyin datas in admin side like customer name or categorie or products and all others (with ö, ä ü) all will be dispalyed in adminside and shopside fine the only one ist if the customer keyin ö ä or ü in e.g. edit customer this goes wrong .. only in case i store datas from e.g. edit customer the datas will be stored wrong in the dastabse. so the problem must be somwhere by storeing of datas
MrPhil Posted November 13, 2013 Posted November 13, 2013 Check the page encoding in all modes (admin and shop, all the pages you can). Maybe (some of) the customer pages are in a different encoding than your admin pages.
stragami Posted November 13, 2013 Author Posted November 13, 2013 hi it looks like that mb_http_output( "iso-8859-1" ); ob_start("mb_output_handler"); store in catalog/includes/application_top.php fix the problem - right now i add this into my testshop and it show now the correct character like ö,ä,ü ect.
MrPhil Posted November 14, 2013 Posted November 14, 2013 You're telling PHP to convert all output to Latin-1 after that point. You must have inconsistencies in your encodings -- some Latin-1 and some UTF-8. What the consequences are of using this call, I don't know (I have never worked with it). If it works for you, fine, but it's still an ugly chewing gum and baling wire fix to have to add stuff like that.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.