I was translating the website and all was working fine but when I put the files in the online server (linux), the translation worked but the accented letters in spanish appear like this � somebody knows how I can fix it?
-
Any particular programming language? – Ignacio Vazquez-Abrams Apr 20 '12 at 00:46
3 Answers
If you are using PHP, you probably need to add the bind_textdomain_codeset function to tell the system that your mo file is returning UTF-8 (or whatever you have specified in the PO file). So something like this should of the trick:
$language = 'de_DE';
bindtextdomain($language, APP_ROOT.'locale'); // Define domain
textdomain($language); // Choose domain, translation is looking for in locale/de_DE/LC_MESSAGES/de_DE.mo now
bind_textdomain_codeset($language, 'UTF-8'); // Tell the system out MO files will return UTF8

- 11
- 1
-
To be precise, you need to do it if your server is running under a non-UTF-8 locale. If the server’s environment has `LC_CTYPE` set to e.g. `en_US.UTF-8`, it should be fine by default. – Václav Slavík Jun 17 '16 at 11:47
Appeared like � where? If it's in the web page, you need to make sure the translation is in the same character set as the rest of the HTML and that that character set is properly noted on top.

- 1,268
- 13
- 17
-
this appears like : suscríbase (a word in the site) it apears like suscr�base. – otavio Apr 20 '12 at 18:00
It seems me to have the same problem. Can't resolve the � symbols.
I have the charset correctly setted in the top of my html (utf-8), and the .po file is also in utf-8. I tried the bind_textdomain_codeset command but didn't work.
Server is linux.
[ RESOLVED ]
Adding this line: bind_textdomain_codeset("default", "utf-8");
note default instead of language domain. Wonder why..

- 1
- 1