Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

French accents not appearing properly


Recommended Posts

I am having trouble fixing the French accents on my site. The text found in the HEADER-TITLE (inputted in french.php) are working properly. However the text in the TEXT_INFORMATION (inputted in the page under French directory shows the strange characters instead of the accents. I changed the CHARSET from utf-8 to iso-8859-1, in french.php, thinking that may be it, but no change occurred. I'm not sure where else to look to try and fix the issue. I am attaching the screenshot of the page in question to better illustrate what I am saying. Any help would be greatly appreciated. Thank you.


Link to comment
Share on other sites

Every accented character is replaced by an empty box? That's a strange one. My best guess is that you're displaying in Latin-1, but your font does not contain these accented characters. Have you chosen an unusual font for this text? What happens if you change the CSS to specify a more commonly used font?


First of all, don't go changing encodings willy-nilly. Your database needs to be consistently all one or the other (typically Latin-1 or UTF-8). All the data in the database needs to match the specified encoding. All the language support files need to be written in that same encoding. Any CHARSET or setlocale in your language files needs to match. Finally, your output pages should indicate the correct matching encoding, and your server must not be misconfigured to ignore or override the encoding.


If you have UTF-8 encoded text (multibyte accented characters) and try to display it in Latin-1 or Windows-1252, you should see a sequence of 2 or 3 odd accented characters. If you have a single byte Latin-1 or Windows-1252 character and try to display it in UTF-8, you would normally see a ?-in-black-diamond. If you have a legitimate multibyte character in UTF-8, but your chosen font doesn't have it, you would normally see a box with a 4-digit hex value inside it. I think the equivalent in Latin-1 might be an empty box.


Go into your browser's View > Character Encoding (or the equivalent) and see if it matches what is expected. You can try flipping between UTF-8 and Latin-1/ISO-8859-1/Western European/Windows-1252 to see if you gain any information there.


What version of osC? 2.3 should be UTF-8 by default. When you installed French language, were you careful to make sure your package was for 2.3 (UTF-8) or for 2.2 (Latin-1)? Has your host done anything unusual, such as restore a database update?

Link to comment
Share on other sites

Thank you MrPhil for replying. I changed the font from "Quattrocento Sans" to Verdana, a pretty much standard font. I switched from utf-8 to iso-8859-1 back and forth. Checked my browser's view. Nothing happened. I have three other oscommerce websites on the same server and don't have this issue. On this particular oscommerce program, it is the newest version, 2.3.1 and I am using a template. I reviewed the template css files and others and changed the font where possible. So I tend to think that it has something to do with the new version and the template.

Link to comment
Share on other sites

What encoding does the browser tell you that the page is being presented in? I've never seen UTF-8 give empty boxes -- what browser are you using, in case it's an oddball one? French accented characters should be found in any Latin-based alphabet font, as well as any UTF-8 font. A completely empty box leads me to suspect that you're actually in Latin-1 or some other single byte encoding, but any of those ought to show something for those bytes. Be sure to confirm that your language pack files are for UTF-8 (if that's what your database is) and they don't have a setlocale() etc. call specifying ISO-8859-1 or any other non-UTF-8 encoding. Can you give out the URL to your site so we can take a look? If you don't want to give it out in public, feel free to PM it to me.

Link to comment
Share on other sites

Perhaps things have by now been sorted out by private correspondence. But if they haven't then try using an entity like


& e a c u t e ;




& # 2 3 3 ;


without the spaces of course.

Link to comment
Share on other sites

  • 8 months later...

Hi guys,

I have a similar problem with my admin page. The admin is in english but I also have the french language package installed, How do I get the french accents to display properly ? It is important for the shipping address to clients.

Thanks for your help/ advice I appreciate it?


Link to comment
Share on other sites



pour remettre les accents français, j'ai utilisé la méthode décrite dans :



« J'ai installé la en anglais puis ajouté les fichiers en fr de la 2.3 que auxquels j'ai appliqué les instructions de mise à jour jusque

Sur la page d'accueil, le "é" de Décembre est un losange noir comprenant un "?".



in those 2 files, around lines 17 and 19, change from:


setlocale(LC_TIME, 'en_US.ISO_8859-1');



setlocale(LC_ALL, array('en_US.UTF-8', 'en_US.UTF8', 'enu_usa'));

Un commentaire est indiqué plus bas et mentionne ceci pour le français:


Please also make the same change to the main catalog and admin language files for other languages you have installed. Example language UTF-8 locales are:


French (France): fr_FR.UTF-8, fr_FR.UTF8, fra_fra

J'ai donc codé comme ceci dans french.php:


setlocale(LC_ALL, array('fr_FR.UTF-8', 'fr_FR.UTF8', 'fra_fra'));


Juste pour info, cette technique peut être transposée à d'autres pages.

par exemple, dans l'admin, pour banner_statistics.php, j'avais le même soucis que j'ai résolu en remplaçant, en ligne 46


'text' => strftime('%B', mktime(0,0,0,$i)))



'text' => utf8_encode(strftime('%B', mktime(0,0,0,$i))));

bref, pour généraliser la solution, on ajoute



avant strftime et on pense bien à fermer la nouvelle parenthèse à la fin. »


Problème d'affichage du sigle € , de la virgule avant les décimales et virgule après les milliers :


Modifications à faire dans Admin, Localisation, Devise comme indiqué dans :


Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...