Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Fri Feb 13, 2015 4:27 pm 
Offline
Newbie

Joined: Sat Feb 07, 2015 10:52 pm
Posts: 2
On my Debian machine, French texts are displaced properly when retrieving from the data, but the display of french words with accented letters would have crazy characters like avancée after updating the database. I do not have this issue on my local machine, which is a mac. This problem started happening when I deployed the site on the Debian. Would anyone help me solve this problem?

Best


Top
   
PostPosted: Fri Feb 13, 2015 8:44 pm 
Offline
Senior Member

Joined: Fri Feb 13, 2015 8:12 pm
Posts: 101
You are probably using utf8 as input where latin1 was expected, and the result is that the input is being converted from latin1 (or iso-8859-1) to utf8 when no conversion at all was needed. If you are importing a MySQL dump, try adding --default_character_set=utf8 option. Example:

Code:
cat dump.sql | mysql  whateveroptions  --default_character_set=utf8


BTW: Try this and you will see what happens when you convert text which is already utf8 from latin1 to utf8:
Code:
echo avancée | recode latin1.. | recode latin1.. | recode latin1..


Top
   
PostPosted: Fri Feb 13, 2015 10:46 pm 
Offline
Newbie

Joined: Sat Feb 07, 2015 10:52 pm
Posts: 2
Thanks a lot. That has solved the display from the database. However, it appears the whole system is behaving that way. How do you solve the fact that the system is not fully integrated to utf8?


Top
   
PostPosted: Sat Feb 14, 2015 6:31 am 
Offline
Senior Member

Joined: Fri Feb 13, 2015 8:12 pm
Posts: 101
You can start by configuring a locale which is appropriate for you:
Code:
dpkg-reconfigure locales

If you are from France, select "fr_FR.UTF-8 UTF-8".

Sometimes the problem is more "the charset is not declared properly" than "not everything is in utf8". For example, if you look at email headers, you will see lines like "Content-Type: text/plain; charset="iso-8859-1". By using this information, email clients know when and how charset conversions should be made, without making mandatory that everybody uses utf8.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group