Symptom: After importing a translation you find all kind of weird characters or question marks on your site.
Solution 1: The translator did not use UTF-8. Drupal is fully UTF-8 aware and expects translations to be supplied in that character set as well.
You can change the charset of a .po file using GNU msgconv. Or with XEmacs you can use this command:
C-x <RET> f utf-8 <RET>
Please also file a bug against the translation in question asking them to change the character set to UTF-8.
Solution 2: You do not have the correct font installed to display the language in question, this is an issue wit your browser or operating system.
If you want to check the character set of a .po file, you can use the "file" command.
file *.po
Example output:
ca.po: UTF-8 Unicode PO (gettext message catalogue) text
de.po: UTF-8 Unicode PO (gettext message catalogue) text, with very long lines
fr.po: UTF-8 Unicode PO (gettext message catalogue) text
it.po: UTF-8 Unicode PO (gettext message catalogue) text
Comments
Whenever I type foreign
Whenever I type foreign characters in an article post or a comment, they get converted to question marks ("????")
I have tried different themes and computers, as well as different Drupal installations!!
Other websites don't have this issue. Is there an installation problem I am doing wrong?
Note that I am not using any translation modules and I don't think I need to. The site is a default site with regular comment module and Story or Page option.
The characters I am interested in are:
Armenian (example: Հայերէն կը գրեմ)
Turkish
Note that it works on this site as you see above and any other Drupal site, except the one I am using.
Any feedback is much appreciated.
PHP setting detect_unicode spoils it
I had the ???? issue.. This is after getting the basics right - setting the unicode charset META header. I then found that the test page worked in php 5.1.6 but not on php 5.2.9. The setting "detect_unicode" is set to "on" by default (if php is compiled that way, which is true of the xampp stack). Switching it off in php.ini got it working for me.
This issue is documented in the PHP community here: http://bugs.php.net/bug.php?id=36711
collation
I had this problem, which turned out to be a MySQL collation issue. To fix, you need to change the collation of *everything* (the database, the tables, and the fields) to UTF-8.
I found the easiest way to do this was to dump the entire database to a .sql file, then open the dump file in a simple text browser. If you search for the "CREATE" statements, you'll see that there are references to other "character sets" or charsets. Change all of these references to utf8.
So for instance, I did a global search and replace from "character set latin1" to "character set utf8" and that did it. You may also have to replace "CHARSET=latin1" to "CHARSET=utf8"
Also make sure that when you create the database in the first place, that you're creating it with utf8 collation. (You can't fix this with the sql dump file, as I understand it, but you can fix it with in phpmyadmin or with the appropriate sql command).
Worked!
Thanks, changing the character set in phpAdmin worked for me too. I had installed Drupal using Fantastico scripts, which for some reason had the wrong character set in the databases.
Now all are fine. thanks!
foreign characters in the menu weird
I have used artisteer to generate a theme
it works fine, except from the menu where letters å, ä and ö look strange with strange symbols.
It seems like you had the same problem. How do I do to change the character set in phpAdmin?
Henrik