Forums / General Questions / Small encoding problem with French accents

Small encoding problem with French accents

Results 1 to 18 of 18
22 Mar 2012, 17:03
#1
gotyed avatar

gotyed

New Zenner

Join Date:
Jan 2012
Posts:
65
Plugin Contributions:
0

Small encoding problem with French accents

Hello,

I run my website in English and French.

On the French index page, the title is messed up because of the accents.

All other French content (product descriptions, names etc) are OK.

When changing the meta_tags.php encoding, I can or see the title the way it should be (and the rest is messed up) or just the content and not the title.


Any idea what's wrong?

Thanks!!
22 Mar 2012, 22:48
#2
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Posts:
2,850
Plugin Contributions:
3

Re: Small encoding problem with French accents

wheres the website?
23 Mar 2012, 11:24
#3
gotyed avatar

gotyed

New Zenner

Join Date:
Jan 2012
Posts:
65
Plugin Contributions:
0

Re: Small encoding problem with French accents

W w w . P i c s p i c k . C o m
24 Mar 2012, 16:15
#4
gotyed avatar

gotyed

New Zenner

Join Date:
Jan 2012
Posts:
65
Plugin Contributions:
0

Re: Small encoding problem with French accents

Any ideas? I still can't figure it out..
24 Mar 2012, 20:12
#5
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Posts:
2,850
Plugin Contributions:
3

Re: Small encoding problem with French accents

The generated html that arrives in the browser says it is 8859 encoded.

The page title text comes out of the database and is utf-8 (change the browser expectations, FFox View-Character encoding to utf8 to show it correctly).

However your product descriptions are 8859 as these go wrong when you change to utf-8.

So the data in your database is in different character sets.

Have you just upgraded to Zen Cart 1.5?
24 Mar 2012, 20:59
#6
gotyed avatar

gotyed

New Zenner

Join Date:
Jan 2012
Posts:
65
Plugin Contributions:
0

Re: Small encoding problem with French accents

Hello,

Thank you for your reply.

I'm with 1.3.9h.

If I change my database to 8859, it should solve the problem?
25 Mar 2012, 11:07
#7
gotyed avatar

gotyed

New Zenner

Join Date:
Jan 2012
Posts:
65
Plugin Contributions:
0

Re: Small encoding problem with French accents

BTW,

I checked today, and when opening a product, with accents in the product name, it shows without any problem in the title. Just the same "generic" title that is used for all the pages can't be seen correctly.
25 Mar 2012, 15:12
#8
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Posts:
2,850
Plugin Contributions:
3

Re: Small encoding problem with French accents

If I change my database to 8859, it should solve the problem?
It looks as though the text in your database is 8859.

The common title comes from the language file.

Open your french.php or /YOUR_TEMPLATE/french.php if you are using it, with something that can show the encoding like Notepad++ and check the file is encoded as ANSI and not UTF-8.

If it is UTF-8,
copy all,
cut,
change encoding to ANSI,
paste,
save.
25 Mar 2012, 15:30
#9
gotyed avatar

gotyed

New Zenner

Join Date:
Jan 2012
Posts:
65
Plugin Contributions:
0

Re: Small encoding problem with French accents

Hi,

Thank you for your answer.

According to the phpMyAdmin, I get the following info - )MySQL connection collation Documentation - utf8_general_ci) and (MySQL charset: UTF-8 Unicode (utf8))



I took the /includes/languages/french.php file and did as you suggested, (it was ANSI as UTF8) converted it to ANSI, but it still doesn't work.

Thanks!
30 Mar 2012, 18:52
#10
oopsibrickedit avatar

oopsibrickedit

Zen Follower

Join Date:
Mar 2012
Posts:
132
Plugin Contributions:
0

Re: Small encoding problem with French accents

Hi,

I have little bit similar problem. I transferred an old database from 1.3.7 When using old 1.3.7 it worked fine on new server, after I upgraded to 1.5 and added additonal language pack conatining umlauts it wrecked umlauts.

Db look like it's using table encoding isolatin 1 swedish exept new admin_ tables are UTF-8. When browsing with phpmyadmin data is ok, umlauts & all scandinavian letters showing

so umlauts are like :
À-> should be ä
Both in navigation and body text. Tried several fixes but nothing helps.

I am also using old template from 1.3.7 But I think that's not the problem, Tried default template with same issue. Something in the new 1.5 bricks the char encoding. Perhaps that .htaccess files that are added for security?

So is there any easy(or difficult but bulletproof) fix for this?

I am on a tight schedual, by tomorrow I should be launching the site.
:oops:
Thanks in advance.
30 Mar 2012, 20:47
#11
oopsibrickedit avatar

oopsibrickedit

Zen Follower

Join Date:
Mar 2012
Posts:
132
Plugin Contributions:
0

Re: Small encoding problem with French accents

I took the server response header also:

Status: HTTP/1.1 200 OK
Set-Cookie: mediaplan=r1; path=/; expires=Mon, 02-Apr-2012 03:35:22 GMT
Date: Fri, 30 Mar 2012 15:28:10 GMT
Server: Apache/2.2.X
X-Powered-By: PHP/5.3.10
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Encoding: gzip
Vary: Accept-Encoding
Set-Cookie: zenid=rl36jerr6jc0bke5qv9ro6vo61; path=/xstore; domain=.xstore.x; HttpOnly
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html; charset=iso-8859-15

That chunked encoding is little unknown to me. Apache 2.2 + Mod-php? If I remember right some things like webdav nginx didn't allow login with chunked encoding if password had umlauts.
31 Mar 2012, 02:17
#13
oopsibrickedit avatar

oopsibrickedit

Zen Follower

Join Date:
Mar 2012
Posts:
132
Plugin Contributions:
0

Re: Small encoding problem with French accents

DrByte:

https://www.zen-cart.com/tutorials/index.php?article=414


Thank you very much.
Now I feel stupid. That was among first things I checked but FTP transfer had failed and it still was utf-8! I owe you one. Works like a beast. Maybe a coffee & donut to tip jar(rest of evening goes finding that I assume).
31 Mar 2012, 02:57
#14
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,506
Plugin Contributions:
173

Re: Small encoding problem with French accents

Glad it was a simple fix for you :)

As for tips, it's easy: www.zen-cart.com/donate

Cheers!
19 Apr 2012, 01:48
#15
oopsibrickedit avatar

oopsibrickedit

Zen Follower

Join Date:
Mar 2012
Posts:
132
Plugin Contributions:
0

Re: Small encoding problem with French accents

DrByte:

Glad it was a simple fix for you :)

As for tips, it's easy: www.zen-cart.com/donate

Cheers!


Well, donating was easy. Unfortunately everything is still not ok.

My early fix attempts included changing all admin tables collation to UTF-8 Now I think that or some earlier fix attempt is messing around because on live site everything looks ok but when trying to update or make new product a) on some products it looses title in admin eg. on live site title looks ok but when trying to update it shos only blank title. Also when trying to update an old product it seems to produce error:

[19-Apr-2012 01:12:25 UTC] PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in /includes/modules/product/collect_info.php on line 299

[19-Apr-2012 01:12:25 UTC] PHP Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in /includes/modules/product/collect_info.php on line 401

So some of my earlier fixes seems to mess things or that earlier admin utf-8 collation change

Also search produces wrong character sets & also contact form

"Funny" thing was that it seemed to work & then everything went wrong again after updating few products.

Starting to get frustrated with this, so close...but:oops:
06 Feb 2014, 18:57
#16
jobooo avatar

jobooo

New Zenner

Join Date:
Jan 2014
Posts:
1
Plugin Contributions:
0

Re: Small encoding problem with French accents

torvista:

It looks as though the text in your database is 8859.

The common title comes from the language file.

Open your french.php or /YOUR_TEMPLATE/french.php if you are using it, with something that can show the encoding like Notepad++ and check the file is encoded as ANSI and not UTF-8.

If it is UTF-8,
copy all,
cut,
change encoding to ANSI,
paste,
save.


WORKED FOR ME THANKS!!

Little note: I did not have to copy and save as new file, as the last version of notepad allows to change encoding in the menu.
23 Oct 2016, 11:23
#17
cdclp avatar

cdclp

New Zenner

Join Date:
Oct 2016
Posts:
3
Plugin Contributions:
0

Re: Small encoding problem with French accents

Hello,
I upraded zencart 1.3.9h. to 1.1.5a by myself from this procedure: https://www.zen-cart.com/content.php?148
I had the french language pack installed on my 1.3.9h version. And the box_multi_EZ_pages module.

My site is: h t t p : / / w a - s h i a t s u - n i c e . f r

Here are the php and MySQL versions:
Serveur Hôte: mars.fr.planethoster.net (10.185.0.21) Hôte Base de Données: localhost (127.0.0.1)
OS Serveur: Linux 3.10.0-427.10.1.lve1.4.7.el7.x86_64 Base de Données: MySQL 5.5.5-10.1.18-MariaDB

Serveur HTTP: LiteSpeed
Version PHP: 5.6.27 (Zend: 2.6.0) PHP Limite mémoire: 256M PHP Safe Mode: Off
PHP Uploads de fichiers: On Taille max upload par fichier: 64M Taille max POST: 128M

Since this upgrade everything until now is well. Including the french font with accents in all the website :)).
The site is in UTF-8. And the database also.

I just have the pages uploaded from "tools / define page editor" that can't be correctly loaded:

define_main_page
define_page_2
define_privacy
...

Here is an exemple:
http://wa-shiatsu-nice.fr/index.php?main_page=contact_us

The "é" becomes "?" in a black square.

Would you have an idea?

These page are made in UTF-8. They shouldn't have trouble.

Best regards.
23 Oct 2016, 14:00
#18
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Posts:
13,980
Plugin Contributions:
46

Re: Small encoding problem with French accents

@Cdclp, now that your database is setup in utf8 (you ran the "Convert DB to UTF8" script, right?) and you've set your french.php file to indicate that the site uses UTF8 as its encoding scheme ... it's time to update your language files (like that define_contact_us.php).

It looks like that file (and most likely others that you've "carried over" from your 1.3.9h/ASCII version) is still ASCII-encoded; that's where the funny symbols originate.

What you can do is use a file-editor (like NotePad++ ... not Word or DreamWeaver) and, for each file (NotePad++):
  1. Open the existing file, e.g. define_contact_us.php.
  2. Click the "Encoding" tab. If it shows "Encode in UTF-8", you're finished for this file. Continue, otherwise.
  3. Open a new file, click the "Encoding" tab and make sure that "Encode in UTF-8" is selected.
  4. Go back to the original file, press Ctrl+a (to select all) and then Ctrl+c (to copy those contents).
  5. Click over to the new file and paste (Ctrl+v) the contents you just copied, converting those contents to UTF-8.
  6. Save the original file as a backup, e.g. define_contact_us.php~
  7. Save the new file as the to-be-used name, e.g. define_contact_us.php

It's a lengthy process, but hopefully you don't have many language files to handle!