Zen Cart Logo
Forums / Addon Language Packs / Confused about foreign characters

Confused about foreign characters

Views: 8,314

Results 1 to 7 of 7
18 Jul 2014, 2:41 PM
#1
jeking avatar

jeking

Totally Zenned

Join Date:
Oct 2005
Location:
Chicago, IL USA
Posts:
1,592
Plugin Contributions:
0

Confused about foreign characters

My client's site is used almost entirely in Sweden, so the default language is Swedish. The site is fine, the problem is the customer names and addresses often show up with invalid characters, see attached image, causing problems for shipments. The site uses iso-8895-1 character set (it's 1.3.9).

Attachment 14297

I thought upgrading to 1.5.3 and converting to UTF-8 would fix this. The upgraded site, 1.5.3, now has character problems on the store front. The characters ö and ä display as ?

The checked the source code and it is displaying in UTF-8, so why do the characters display incorrectly?

18 Jul 2014, 3:07 PM
#2
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,091
Plugin Contributions:
56

Re: Confused about foreign characters

What collation is being used in your database? Something latin1_ or something utf8_? If the database is using a latin1_ type collation, then you should edit your two configure.php files and add the following statement to each (somewhere around the other database definitions):

define ('DB_CHARSET', 'latin1');
18 Jul 2014, 4:04 PM
#3
jeking avatar

jeking

Totally Zenned

Join Date:
Oct 2005
Location:
Chicago, IL USA
Posts:
1,592
Plugin Contributions:
0

Re: Confused about foreign characters

When I do that, even more characters now mis-display (if that's a word).

18 Jul 2014, 5:11 PM
#4
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,091
Plugin Contributions:
56

Re: Confused about foreign characters

jeking:

When I do that, even more characters now mis-display (if that's a word).
It is now!:laugh:

Let's start at the beginning. What collation is your database using? You can see this by using your cPanel's phpMyAdmin tool. When you select the database and view all the tables, each table that contains textual information will show a collation like latin1_swedish_ci or utf8_general_ci. When you use that tool to look at one of your mis-displayed product's raw information, do the funky characters show there?

18 Jul 2014, 5:41 PM
#5
jeking avatar

jeking

Totally Zenned

Join Date:
Oct 2005
Location:
Chicago, IL USA
Posts:
1,592
Plugin Contributions:
0

Re: Confused about foreign characters

Cool, a new word exists...

Collation is 'latin1_general_ci', so the answer would yes, I see 'funky characters'.

With the db set as iso-8859-1, the store front is all good. Only customer entered data is funky...and that's the problem I am trying to address.

21 Jul 2014, 2:45 PM
#6
jeking avatar

jeking

Totally Zenned

Join Date:
Oct 2005
Location:
Chicago, IL USA
Posts:
1,592
Plugin Contributions:
0

Re: Confused about foreign characters

Looking for some help on how to get Swedish characters to display correctly. The original problem was addresses entered by customers.

Thanks,
Jim

21 Jul 2014, 6:22 PM
#7
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,091
Plugin Contributions:
56

Re: Confused about foreign characters

Check the following settings, where xxxxx is your current template directory:

  1. /includes/configure.php, /YOUR_ADMIN/includes/configure.php. DB_CHARSET set to latin1
  2. /includes/languages/xxxxx/english.php, swedish.php, /YOUR_ADMIN/includes/languages/english.php, swedish.php. CHARSET set to iso-8859-1
  3. /includes/languages/english.php, swedish.php, /YOUR_ADMIN/includes/languages/english.php, swedish.php. setlocale function is using an iso-8859-1 variant.
    Note that for the last files, you need to check in the **non-template override **versions of the language files. Since these files are loaded after your template-override versions, the values used in the setlocale function call for these files will take precedence.