Package: glibc Version: 2.3.2-95.20.1AX Addition information about the setlocale puzzle is listed below gcc version:gcc-3.2.3-36 kernel version:kernel-2.4.21-9.38AX I used strace tool to log the run process of my program in both reboot mode and shell mode, the result of those two logs are attached. it is quite strange to find out that the setlocale function's strace information is totally same in those two modes, but the file opened is differ. In reboot mode, open("/home/local/mo/en_US/LC_MESSAGES/test.mo", O_RDONLY) = 3 In shell mode open("/home/local/mo/ja_JP.eucJP/LC_MESSAGES/test.mo", O_RDONLY) = -1 ENOENT (No such file or directory) open("/home/local/mo/ja_JP.eucjp/LC_MESSAGES/test.mo", O_RDONLY) = -1 ENOENT (No such file or directory) open("/home/local/mo/ja_JP/LC_MESSAGES/test.mo", O_RDONLY) = 3 Is it a bug or all thing turn out to be myself's misuse? Any tips is appriciated Thanks in advance Gewj. Gewj wrote: > Package: glibc > Version: 2.3.2-95.20.1AX > > > I am root and using Linux 2.4.21-9.38AX i686(Miracle3.0) with > glibc-2.3.2-95.20.1AX > > > When I used the following code in a program and start it in rc3.d(such > as S99abc, the last one in the rc3.d) > > #define _(String) gettext(String) > > strcpy(moname,"test"); > setlocale(LC_ALL, "ja_JP"); > bindtextdomain(moname, "/home/local/mo"); > textdomain(moname); > > memset(uid, 0, MAX_LINE); > memset(lpBuffer, 0, 1000);; > > strcpy(uid, "0xC0040903"); > strcpy(lpBuffer, _(uid)); > > the dir structure of /usr/local/mo is list below: > /home/local/mo > -|en_US > -|LC_MESSAGES > -|ja_JP > -|LC_MESSAGES > > > when I reboot the machine, gettext("0xC0040903") return the string > defined in en_US .mo file instead of in ja_JP .mo file. > But when I run the same program after reboot(say, through shell) ,it > return the right string that define in ja_JP .mo file. > > > > -----Test program------- > > #include > #include > #include > #include > #include > > #include > #include > #include > #include > > #define MAX_LINE 64 > #define _(String) gettext(String) > > int main(int argc ,char * argv[]) > { > char moname[MAX_LINE]; > char uid[MAX_LINE]; > char lpBuffer[1000]; > > memset(moname,0,MAX_LINE); > strcpy(moname,"test"); > > setlocale(LC_ALL, "ja_JP"); > bindtextdomain(moname, "/home/local/mo"); > textdomain(moname); > > memset(uid, 0, MAX_LINE); > memset(lpBuffer, 0, 1000); > > strcpy(uid, "0xC0040903"); > strcpy(lpBuffer, _(uid)); > printf("lpBuffer = %s\n",lpBuffer); > syslog(6,"lpBuffer = %s",lpBuffer); > > return strlen(lpBuffer); > } > > >