I'm translating a web page from English to Spanish using gettext, but I'm 
having problems with UTF-8.

The problem:
All my web pages translated with gettext declare themselves as UTF-8 encoding 
but it is actually iso-8859-1 (latin-1).
I reach that conclusion using Firefox to enforce the encoding the page is 
viewed in. Firefox detects page encoding as UTF-8 but displays boxes instead of 
regular characters. If I force Firefox to use iso-8859-1 the characters are 
displayed correctly.
Text from web pages wich have not been translated with gettext is displayed 
correctly with UTF-8 encoding, so I'm sure it's a gettext problem.

Te question:
Why msgfmt generates de .mo file in iso-8859-1 and not in UTF-8? How can I 
solve it?

If it helps:
-All my source files (*.php) are in UTF-8.

-APACHE is set to use UTF-8 by default UTF-8 (AddDefaultCharset UTF-8)

-My .po file is in UTF-8:
# file locale/es_ES/messages.po
 locale/es_ES/messages.po: UTF-8 Unicode PO (gettext message catalogue) text

-I've set charset to UTF-8 in the .po header:
# grep charset locale/es_ES/messages.po
"Content-Type: text/plain; charset=UTF-8\n"


And the commands I've used to generate the .pot,.po and .mo files are:
# mkdir -p locale/es_ES/LC_MESSAGES/
# xgettext --indent --no-wrap --sort-by-file --from-code=UTF-8 --output 
locale/messages.pot *.php
# cp locale/messages.pot locale/es_ES/messages.po
# msgfmt --verbose --output-file locale/es_ES/LC_MESSAGES/messages.mo 
locale/es_ES/messages.po


T.I.A
-- 
gentoo-user@gentoo.org mailing list

Reply via email to