Forums / General Questions / Accent replaced by special characters in ez-pages box heading

Accent replaced by special characters in ez-pages box heading

Locked

Started by petek on 16 Jun 2011, 12:40 PM · Views: 2,810

Results 1 to 13 of 13
This thread is locked. New replies are disabled.
16 Jun 2011, 12:40 PM
#1
petek avatar

petek

Zen Follower

Join Date:
Jan 2008
Location:
Chevreuse, France
Posts:
278
Plugin Contributions:
0

Accent replaced by special characters in ez-pages box heading

This has only happened with the ez-pages box heading. "Actualités" is being shown as "Actualités" whereas all the titles, product categories, product descriptions etc. are being correctly shown. Is this something to do with ez-pages or has something been broken. I would add that I haven't changed any of my files (apart from "ez_pages_definitions.php"). Any ideas ? Thanks !

Pete
zc 1.3.9h
www.gardenserre.fr

16 Jun 2011, 2:20 PM
#2
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,189
Plugin Contributions:
0

Re: Accent replaced by special characters in ez-pages box heading

Look here:

includes/ languages/ english/ extra_definitions/your_template/ ez_pages_definitions.php

define('BOX_HEADING_EZPAGES','Actualités');

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.

Zen Cart Certified hosting at myZenCartHost.com.

16 Jun 2011, 2:38 PM
#3
petek avatar

petek

Zen Follower

Join Date:
Jan 2008
Location:
Chevreuse, France
Posts:
278
Plugin Contributions:
0

Re: Accent replaced by special characters in ez-pages box heading

haredo:

Look here:

I don't get you. That's where I've changed the title (I've had to delete the accent temporarily for the time being if you look at the site). The problem is that in the front end of the site, if I add the accent "é" the title displays "Actualités" whereas all the other box headings show correctly the French accents. So the problem appears to be solely in connection with ez pages.

Pete
zc 1.3.9h
www.gardenserre.fr

16 Jun 2011, 3:08 PM
#5
petek avatar

petek

Zen Follower

Join Date:
Jan 2008
Location:
Chevreuse, France
Posts:
278
Plugin Contributions:
0

Re: Accent replaced by special characters in ez-pages box heading

haredo:

Have you read up on this:

Many thanks. I've got an html editor for all that so replacing the "é" by "é" solves the problem but what I don't understand is why this only occurs with the ez pages heading and none of the others ? Weird !

Pete
zc 1.3.9h
www.gardenserre.fr

16 Jun 2011, 4:18 PM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: Accent replaced by special characters in ez-pages box heading

That looks like a conflict between character sets ... as if your database is set to one thing but your language file is set to another. Or maybe you're editing french text which wants a UTF8 or other character set, when your admin is in english mode and set to iso-8859-1 or some other non-matching character set.

Many possibilities.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

17 Jun 2011, 7:22 AM
#7
petek avatar

petek

Zen Follower

Join Date:
Jan 2008
Location:
Chevreuse, France
Posts:
278
Plugin Contributions:
0

Re: Accent replaced by special characters in ez-pages box heading

DrByte:

That looks like a conflict between character sets ... as if your database is set to one thing but your language file is set to another. Or maybe you're editing french text which wants a UTF8 or other character set, when your admin is in english mode and set to iso-8859-1 or some other non-matching character set.

Many possibilities.

Yes, in french.php, the language code is iso-8859-1 > // charset for web pages and emails

define('CHARSET', 'iso-8859-1');whilst the database specifies UTF-8 Unicode (utf8). However, this doesn't appear to have any bearing anywhere else on the site, its just the ez pages heading that has a problem. Could it just be a case of changing iso-8859-1 in french.php to utf-8 or is it more complicated that ?

Pete
zc 1.3.9h
www.gardenserre.fr

17 Jun 2011, 2:57 PM
#8
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: Accent replaced by special characters in ez-pages box heading

petek:

includes/ languages/ english/ extra_definitions/your_template/ ez_pages_definitions.php

define('BOX_HEADING_EZPAGES','Actualités');

What's the file encoding set to for that file? If your site is operating as iso-8859-1 (aka latin1), then you'll need to be sure that your text editor is also saving the file in that format. Don't save the files in UTF8 encoding if you're not using UTF8 on the rest of your site.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

17 Jun 2011, 3:35 PM
#9
petek avatar

petek

Zen Follower

Join Date:
Jan 2008
Location:
Chevreuse, France
Posts:
278
Plugin Contributions:
0

Re: Accent replaced by special characters in ez-pages box heading

DrByte:

What's the file encoding set to for that file? If your site is operating as iso-8859-1 (aka latin1), then you'll need to be sure that your text editor is also saving the file in that format. Don't save the files in UTF8 encoding if you're not using UTF8 on the rest of your site.

The text editor I'm using is Dreamweaver. There's nothing in ez_pages_definitions.php to suggest what its file encoding is - how do I find that out ? Apart from that, all I can see is that the main language file, ie french.php, specifies iso-8859-1 as the file encoding whereas when I look at my database, I see nothing but UTF8. But this doesn't affect the way all the other text on the site is displayed.

Pete
zc 1.3.9h
www.gardenserre.fr

17 Jun 2011, 3:53 PM
#10
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: Accent replaced by special characters in ez-pages box heading

Let's leave your database out of this, because the text in question is coming from a PHP file, not the database.

The "strange characters" you said are being displayed are classic examples of trying to display accented characters in a character set that doesn't support them.
It seems as though the following is happening:

a) because your french.php file has CHARSET set to iso-8859-1, that will (as expected) set <meta charset=iso-8859-1>. Do NOT change this.
b) next, your ez_pages_definitions.php contains a define for 'Actualités', but I'm guessing that the file has somehow been saved as UTF-8 encoding, not ANSI/ASCII encoding.

Thus, when the browser encounters the 'Actualités' word, it tries to render the é that's stored as a UTF8-encoded symbol, but the translation of that to iso-8859-1 for display converts it to é instead.

I suspect the solution is to use a plain text editor, such as the free Notepad++ (notepad-plus.sf.net) and save the file in iso-8859-1 / latin1 encoding, and NOT in utf8-encoding. Then upload the edited file back to your server. I no longer use Dreamweaver, and don't recall what options it has for saving files in various encodings.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

17 Jun 2011, 4:49 PM
#11
petek avatar

petek

Zen Follower

Join Date:
Jan 2008
Location:
Chevreuse, France
Posts:
278
Plugin Contributions:
0

Re: Accent replaced by special characters in ez-pages box heading

DrByte:

Let's leave your database out of this, because the text in question is coming from a PHP file, not the database.

The "strange characters" you said are being displayed are classic examples of trying to display accented characters in a character set that doesn't support them.
It seems as though the following is happening:

a) because your french.php file has CHARSET set to iso-8859-1, that will (as expected) set <meta charset=iso-8859-1>. Do NOT change this.
b) next, your ez_pages_definitions.php contains a define for 'Actualités', but I'm guessing that the file has somehow been saved as UTF-8 encoding, not ANSI/ASCII encoding.

Thus, when the browser encounters the 'Actualités' word, it tries to render the é that's stored as a UTF8-encoded symbol, but the translation of that to iso-8859-1 for display converts it to é instead.

I suspect the solution is to use a plain text editor, such as the free Notepad++ (notepad-plus.sf.net) and save the file in iso-8859-1 / latin1 encoding, and NOT in utf8-encoding. Then upload the edited file back to your server. I no longer use Dreamweaver, and don't recall what options it has for saving files in various encodings.

Many thanks ! Using Notepad++ did the trick. I would imagine you can change the encoding in Dreamweaver somewhere but why waste time ? Again, thanks for your help !

Pete
zc 1.3.9h
www.gardenserre.fr

17 Jun 2011, 5:06 PM
#12
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: Accent replaced by special characters in ez-pages box heading

:D

Just a reminder: anytime you use extended-characters in your PHP files, you'll need to save those files in the same encoding format as you have your CHARSET defined to in the lang file for that language.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

18 Jun 2011, 4:43 PM
#13
petek avatar

petek

Zen Follower

Join Date:
Jan 2008
Location:
Chevreuse, France
Posts:
278
Plugin Contributions:
0

Re: Accent replaced by special characters in ez-pages box heading

DrByte:

:D

Just a reminder: anytime you use extended-characters in your PHP files, you'll need to save those files in the same encoding format as you have your CHARSET defined to in the lang file for that language.

Yes thanks. I've found the option in Dreamweaver (edit>preferences fwiw) that allows you to define the encoding for new documents and existing ones for which no specific encoding is defined, which is what happened when I opened ez_pages_definitions.php.

Pete
zc 1.3.9h
www.gardenserre.fr