KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
msgfmt “invalid multibyte sequence” error on a Polish text is corrected by manually editing the MIME Content-Type charset in the template file. Is there some command or option for the xgettext, msginit, msgfmt sequence for setting the MIME type? cat >plt.cxx <<EOF // plt.cxx #include <libintl.h> #include <locale.h> #include <iostream> int main (){ setlocale(LC_ALL, ""); bindtextdomain("plt", "."); textdomain( "plt"); std::cout << gettext("Invalid input. Enter a string at least 20 characters long.") << std::endl; } EOF g++ -o plt plt.cxx xgettext --package-name plt --package-version 1.2 --default-domain plt --output plt.pot plt.cxx sed --in-place plt.pot --expression='s/CHARSET/UTF-8/' msginit --no-translator --locale pl_PL --output-file plt_polish.po --input plt.pot sed --in-place plt_polish.po --expression='/#: /,$ s/""/"Nieprawidłowo wprowadzone dane. Wprowadź ciąg przynajmniej 20 znaków."/' mkdir --parents ./pl_PL.utf8/LC_MESSAGES msgfmt --check --verbose --output-file ./pl_PL.utf8/LC_MESSAGES/plt.mo plt_polish.po LANGUAGE=pl_PL.utf8 ./plt
Tags (comma-separated)
Save Edits
Cancel