www.in.no Posted December 2, 2012 Posted December 2, 2012 Hi, i just install a clean 2.3.3 witch i have in Norwegian. Have adjust the locale all over where i can find it, in both lang.php files set it to utf-8 and nb_NO and checked the DB and got it all overt to UTF-8. Even set it in htaccess. Tried to change it to iso 8859-1 but then all the other characters crashed. ÆØÅ show great all over on the website, but for weekdays i get a diamond ? insted of ø when viewing as a customers -> my account / orders Ordre dato: s�ndag 02 desember, 2012 And in the MySql the ÆØÅ show up as æøå Any tips on how to fix this.
www.in.no Posted December 2, 2012 Author Posted December 2, 2012 I managed to find a solution. It looks like it was the locale settings in the language files. I put this string in and it was showing correctly. Taken from another Norwegian language file used in different cart. setlocale(LC_TIME, 'no_NO.utf-8', 'nb_NO.utf-8', 'no_NO.UTF-8', 'nb_NO.UTF-8', 'nb_NO.utf8', 'no_NO.utf8', 'no', 'nb', 'nob-NO', 'no_NO', 'nb_NO', 'Norwegian_Bokmal', 'nor', 'norwegian', 'bokmal', 'bokmål');
www.in.no Posted December 2, 2012 Author Posted December 2, 2012 But the input to MySql is still not correct... And in the MySql the ÆØÅ show up as æøå Any suggestions to this..
Jan Zonjee Posted December 2, 2012 Posted December 2, 2012 For starters the server of your website is not declaring what character set to expect. But default (I think) this means browsers will assume it iso-8859-1. < Server: Apache/2.2.22 (Unix) mod_ssl/2.2.22 OpenSSL/0.9.8e-fips-rhel5 DAV/2 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 < Transfer-Encoding: chunked < Content-Type: text/html < <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> And not for example: < Server: Apache < Connection: close < Transfer-Encoding: chunked < Content-Type: text/html; charset=UTF-8 Secondly, changing your database to utf-8 also means changing the content in the database to utf-8. What I remember is that the assumption was that you make a backup copy (dump) of tables in the database. Then convert the text file that you now have (the dump) to utf-8 (text editor?) and then reload the utf-8 data back in to the database. Scary, I know.
www.in.no Posted December 2, 2012 Author Posted December 2, 2012 Well, i thought i had done it correctly... I dumped the MySql and open it in Notpad with Arial Unicode MS and saved it again with UTF-8 before i load it back.. The server i have set UTF-8 in htaccess. -> AddDefaultCharset utf-8 The server is osc.fvt.no Have set utf-8 in both catalog and admin.. And it shows correctly all places except in the phpmyadmin when browsing the db. Don't know what impact it will have over time populating the db with those characters and i prefer to have it working before i populate all the addon's and products..
Jan Zonjee Posted December 2, 2012 Posted December 2, 2012 Well, i thought i had done it correctly... I dumped the MySql and open it in Notpad with Arial Unicode MS and saved it again with UTF-8 before i load it back.. That should do it. The server i have set UTF-8 in htaccess. -> AddDefaultCharset utf-8 Indeed that domain is advertising utf-8: < Content-Type: text/html; charset=utf-8 And it shows correctly all places except in the phpmyadmin when browsing the db. phpMyAdmin settings not correct? Or the same problem that the browser is not informed it is UTF-8 there. Perhaps setting it manually in your browser to use UTF-8? Don't know what impact it will have over time populating the db with those characters I'm sure it will be a lot of work correcting if it turns out to be wrong...
www.in.no Posted December 2, 2012 Author Posted December 2, 2012 Thanks for the answer... The table is utf8_unicode_ci The MySql server have this: Tjener: Localhost via UNIX socket Tjenerversjon: 5.0.96-community Protokollversjon: 10 Bruker: norgeswe@@localhost MySQL-tegnsett: UTF-8 Unicode (utf8) I have set chrome to UTF-8 as well, but still garbage is insertet into MySql. But show as expected on the webpage. But i see that also the contact us form has the same problem with UTF-8 in "to email address" and subject at least, but in content æøå show as expected. So there is some UTF ting not working as expected...
Juto Posted December 3, 2012 Posted December 3, 2012 @@www.in.no Hejje Norge! :) 1) Have you look into your Norwegian langugae file? 2) While editing code, have you saved the files in UTF-8? (Esp. all language files) 3) Have you checked that theres no Boom marked? Hilsen fra Sverige Sara Contributions: http://addons.oscommerce.com/info/8010 http://addons.oscommerce.com/info/8204 http://addons.oscommerce.com/info/8681
www.in.no Posted December 4, 2012 Author Posted December 4, 2012 Hei Sverige, I found the error with MySql, i applied a patch from Tim Osc solutions setting the UTF-8 in the query's. So the hole site is now showing correctly, also in MySql. Just have a minor problem with sent email where special character in subject or from name is not shown correctly, but in content it is ok. There are some fixes for this to, but i am not sure witch one to use as i want to keep it as close to the original code as possible. So if anyone know of a official fix for this either in bug reports or git just send a link. Thanks, Arild
Recommended Posts
Archived
This topic is now archived and is closed to further replies.