Solved

French characters and Accents not displayed (PHP mbstring ?)

Posted on 2004-09-17
10
647 Views
Last Modified: 2013-12-16
Hello,
We are using a brand new server running Fedora and Plesk. Only a few sites and a support system (ESupport) installed so far, however we cannot see the French accents being displayed properly.
According to an admin, the problem was narrowed down to the PHP config - A feature called mbstring ?
You can see the problem here :
http://www.copyrightmarker.com/testphpfrenchaccents.php
The correct sentence displayed should be
"Votre demande a bien été transmise à notre service Service Clients é à î, elle sera lue et traitée très prochainement.".

What must be corrected or updated so that our server displays French correctly ?
Thanks.


0
Comment
Question by:Denisvt
  • 3
  • 3
  • 2
  • +1
10 Comments
 
LVL 10

Expert Comment

by:Luxana
Comment Utility
try different character encoding: western (ISO-8859-1)

0
 
LVL 10

Expert Comment

by:Luxana
Comment Utility
or some others not sure....
0
 
LVL 3

Author Comment

by:Denisvt
Comment Utility
Should that be specified in our PHP config and how ? Is it related to "mbstring" ?
0
 
LVL 10

Expert Comment

by:Luxana
Comment Utility
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 48

Expert Comment

by:hernst42
Comment Utility
That problem is not related to mbstring (mbstring is used for japanese/chinese strings where a char consits of multiple bytes, so a strlen must do something different as for ISO-charsets)
make sure there are the correct meta-tags generated in HTML as Luxana suggested e.g:
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-15">
<meta http-equiv="content-language" content="fr">
</head>
<body>
Votre demande a bien été transmise à notre service Service Clients é à î, elle sera lue et traitée très prochainement.
</body>
</html>
Then your string should be displayed correctly
0
 
LVL 3

Author Comment

by:Denisvt
Comment Utility
We have once again experienced the same problem. A whole website that worked fine on another older server was transfered onto that new one, and all accents in French would not display.
I'm desperate to understand that big problem, never seen that before and we cannot host a site if half of its contents looks like rubbish...
Thanks.

0
 
LVL 48

Expert Comment

by:hernst42
Comment Utility
You may compare the two php.ini from the new and the old server, maybe there are different settings which show the wrong characterset for that page.
0
 
LVL 3

Author Comment

by:Denisvt
Comment Utility
I lost a lot of hair on that one, and endless hours...Solution found by chance while discussing with an IT friend who apparently saw that before. Not sure if that applies to all Plesk servers by default, but apparently some have a "bad" default Apache config (the default charset in httpd.conf), that creates problem for Web contents with accents, such as pages in French. Solution :

Edit that Apache config file httpd.conf :

In /etc/httpd/conf/httpd.conf  look for:
AddDefaultCharset UTF-8
comment it out (#AddDefaultCharset UTF-8)
 
Restart apache server (service httpd restart).

All sites fine since then...
Thanks to those who helped.

 
 
0
 
LVL 1

Accepted Solution

by:
DarthMod earned 0 total points
Comment Utility
PAQed with points (250) refunded

DarthMod
Community Support Moderator
0

Featured Post

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

This is the error message I got (CODE) Error caused by incompatible libmp3lame 3.98-2 with ffmpeg I've googled this error message and found out sometimes it attaches this note "can be treated with downgrade libmp3lame to version 3.97 or 3.98" …
SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now