###Edit:
Edit:
###Edit:
Edit:
The solution was in Stack Overflow question Can't make (UTF-8) traditional Chinese character to work in PHP gettext extension (.po and .mo files created in poEdit) Can't make (UTF-8) traditional Chinese character to work in PHP gettext extension (.po and .mo files created in poEdit) and it appears that I needed to explicitly call
The solution was in Stack Overflow question Can't make (UTF-8) traditional Chinese character to work in PHP gettext extension (.po and .mo files created in poEdit) and it appears that I needed to explicitly call
The solution was in Stack Overflow question Can't make (UTF-8) traditional Chinese character to work in PHP gettext extension (.po and .mo files created in poEdit) and it appears that I needed to explicitly call
- 31.3k
- 22
- 110
- 134
gettext character encoding problem
I have the following gettext gettext.po file, which has been translated from a .pot file. II am working on a Linux system (OpensuseopenSUSE if it matters), running gettext 0.17.
msgfmt -c transtest_de_DE.po -o transtest.mo
msgfmt -c transtest_de_DE.po -o transtest.mo
I then check the encoding with the "file" command,
file --mime transtest_de_DE.po
transtest_de_DE.po: text/x-po; charset=utf-8
and then install it to my locale folder and run the program after exporting LANGLANG and LC_CTYPELC_CTYPE, I end up with garbage where the two non-asciiASCII chars are.
If I set my terminal encoding to ISO-8859-2ISO-8859-2, rather than UTF-8UTF-8, then I see the two characters correctly.
Looking inside the generated .mo file with a text editor the file appears to be in utf8UTF-8 as well (I can see the symbols if I set my editor encoding to utfUTF-8).
The program is very simple, and it looks like so:
I am installing the .mo file to /usr/share/locale/de_DE/LC_MESSAGES/transstest.mo /usr/share/locale/de_DE/LC_MESSAGES/transstest.mo, and I have exported LC_CTYPELC_CTYPE and LANGLANG as "de_DE".
whereWhere am I going wrong? Why is gettext giving me the wrong encoding (ISO-8859-2) for my strings, rather than the requested (in the .po file) utfUTF-8??
The solution was on this thread here:
in Stack Overflow question Can't make (UTF-8) traditional Chinese character to work in PHP gettext extension (.po and .mo files created in poEdit) and it appears that I needed to explicitly call
gettext character encoding problem
I have the following gettext .po file, which has been translated from a .pot file. I am working on a Linux system (Opensuse if it matters) running gettext 0.17
msgfmt -c transtest_de_DE.po -o transtest.mo
I then check the encoding with the "file" command
file --mime transtest_de_DE.po
transtest_de_DE.po: text/x-po; charset=utf-8
then install it to my locale folder and run the program after exporting LANG and LC_CTYPE, I end up with garbage where the two non-ascii chars are.
If I set my terminal encoding to ISO-8859-2, rather than UTF-8, then I see the two characters correctly.
Looking inside the generated .mo file with a text editor the file appears to be in utf8 as well (I can see the symbols if I set my editor encoding to utf-8).
The program is very simple, and looks like so:
I am installing the .mo file to /usr/share/locale/de_DE/LC_MESSAGES/transstest.mo , and I have exported LC_CTYPE and LANG as "de_DE".
where am I going wrong? Why is gettext giving me the wrong encoding (ISO-8859-2) for my strings, rather than the requested (in the .po file) utf-8??
The solution was on this thread here:
and it appears that I needed to explicitly call
gettext character encoding
I have the following gettext.po file, which has been translated from a .pot file. I am working on a Linux system (openSUSE if it matters), running gettext 0.17.
msgfmt -c transtest_de_DE.po -o transtest.mo
I then check the encoding with the "file" command,
file --mime transtest_de_DE.po
transtest_de_DE.po: text/x-po; charset=utf-8
and then install it to my locale folder and run the program after exporting LANG and LC_CTYPE, I end up with garbage where the two non-ASCII chars are.
If I set my terminal encoding to ISO-8859-2, rather than UTF-8, then I see the two characters correctly.
Looking inside the generated .mo file with a text editor the file appears to be in UTF-8 as well (I can see the symbols if I set my editor encoding to UTF-8).
The program is very simple, and it looks like so:
I am installing the .mo file to /usr/share/locale/de_DE/LC_MESSAGES/transstest.mo, and I have exported LC_CTYPE and LANG as "de_DE".
Where am I going wrong? Why is gettext giving me the wrong encoding (ISO-8859-2) for my strings, rather than the requested (in the .po file) UTF-8?
The solution was in Stack Overflow question Can't make (UTF-8) traditional Chinese character to work in PHP gettext extension (.po and .mo files created in poEdit) and it appears that I needed to explicitly call