Post by nde » Sat Sep 01, 2007 9:19 am

I have a weird issue about encoding, special characters aren't displaying the right way (€, £, etc).
Lang files still have UTF-8 as setting, but the actual page is served as ISO-8859-1. I see it when selecting page properties in Firefox. The browser chooses iso and specials characters are messed up. This happens in both the front end and admin.
The weird thing is that I didn't touched any of the files before so the problem must be somewhere else...

nde
New member

Posts

Joined
Sat Jun 30, 2007 7:32 am

Post by Daniel » Sat Sep 01, 2007 6:38 pm

nde wrote: I have a weird issue about encoding, special characters aren't displaying the right way (€, £, etc).
Lang files still have UTF-8 as setting, but the actual page is served as ISO-8859-1. I see it when selecting page properties in Firefox. The browser chooses iso and specials characters are messed up. This happens in both the front end and admin.
The weird thing is that I didn't touched any of the files before so the problem must be somewhere else...
I'm going to go over ever page and page it to utf8. I just need to read up on dreamwewver on how to do this.

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by nde » Sat Sep 01, 2007 8:07 pm

Thanks! I already checked some important files myself, but all are in utf-8. Though some in Unix and some in DOS format. Could it be that's an CR/LF issue?

The $ is displaying alright, € converts to '€', and pound sterling to '£'
Also, special chars I type in the admin aren't saved to the database the right way, e.g. an ü always returns an ? after safe.

Browsing though the forum I saw that other people have problems with codepage too...

The weird thing is that the page just renders the right way on my localhost (utf-8), but after uploading the same files to my server they mess up the chars and the page gets served as iso-8859-1.
I use WAMP5 on Vista with all recommended settings, but for my paid host I need to declare 'register globals off' in my .htaccess. Could it be that this is the root of the error?

nde
New member

Posts

Joined
Sat Jun 30, 2007 7:32 am

Post by nde » Sun Sep 09, 2007 12:33 am

I just tried hardcoding the codepage into the main index.php:

Code: Select all

header('Content-Type: text/html; charset=utf-8');
This works for me, all special chars display correctly and the page gets served as utf-8 like specified. I think my host has PHP set to serve pages as iso-8859-1 and you can override it with the Content-Type statement. I will confirm this with them. Maybe you want to add something like below to the index.php and the admins index.php instead of the way you do it now?

Code: Select all

header('Content-Type: text/html; charset=' . $language->get('charset'));

nde
New member

Posts

Joined
Sat Jun 30, 2007 7:32 am

Post by lordcoffee » Thu Sep 27, 2007 5:20 am

Thanks for your help but I'm not very familar with that. Where exactly should I do these changes?

Thanks again :-)

Newbie

Posts

Joined
Tue Sep 25, 2007 5:14 am

Post by Daniel » Thu Sep 27, 2007 5:49 am

I think for the next release I will put a header at the top of the page to force utf-8.

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by ocw » Mon Dec 17, 2007 7:29 am

this is important if you created a new template and are into hardcoding the meta:
you want to check: /catalog/template/ ... /layout.tpl

ocw
Newbie

Posts

Joined
Thu Dec 13, 2007 7:07 am

Post by vectordez » Thu Nov 13, 2008 10:30 pm

Ciao, I've solved this issue by adding this string:

AddDefaultCharset UTF-8

to the  .htaccess in the main folder

Ciao a tutti!

Newbie

Posts

Joined
Thu Nov 13, 2008 1:41 am

Post by hm2k » Thu Nov 13, 2008 11:30 pm

I've not seen this issue, please can you tell me what version you're using?

UK Web Hosting


User avatar
Global Moderator

Posts

Joined
Tue Mar 11, 2008 9:06 am
Location - UK
Who is online

Users browsing this forum: Amazon [Bot] and 28 guests