I downloaded gettext 0.19.1 and libiconv 1.14 source tar balls, and compile/install them on AIX 5.3, and did a test using zh_CN.utf8 locale by a very simple C program, but found it not working (I did a test
on AIX 7.1 using the gettext command before and that one failed, so that's why I tried to build from latest source codes, but found it still not working).
After adding a number of fprintf in the codes, what I found is the issue is in this part:
in gettext-runtime/dcigettext.c
It's the following block caused the AIX gettext not working:
------------------------------------------------------------
# ifndef IN_LIBGLOCALE
const char *encoding = get_output_charset (domainbinding);
# endif
------------------------------------------------------------
the encoding got is
ISO-8859-1, should be UTF-8
The following is the .po file:
# SOME DESCRIPTIVE TITLE.
#
Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <address@hidden>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-06-15 08:38+1000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <address@hidden>\n"
"Language-Team: LANGUAGE <address@hidden>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: intl.c:10
msgid "Try this"
msgstr "试一下这个"
The
test C program is this:
#include <stdio.h>
#include <libintl.h>
#include <locale.h>
int main(int ac, char *av[])
{
setlocale(LC_ALL, "");
textdomain("wzisintl");
printf("%s\n", gettext("Try this"));
}
Thanks and Best Regards
W