LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Problem of "LANG",Help!! (https://www.linuxquestions.org/questions/linux-software-2/problem-of-lang-help-389801/)

gaoeh 12-06-2005 09:06 AM

Problem of "LANG",Help!!
 
My OS is Red hat Linux 9.0,when I "locale",the "LANG=zh_CN.GB18030".
where is the file?I want to fix the LANG in the file to make:LANG=zh_CN.
which file shall I fix? please give me some advice.

I am a chinese.
thanks.

bathory 12-07-2005 01:56 AM

Make the changes you want in /etc/sysconfig/i18n

T.Hsu 12-07-2005 01:57 AM

/etc/sysconfig/i18n

You'd better to set locale to zh_CN.GBK, zh_CN is an alias to GB2312.

gaoeh 12-07-2005 05:04 AM

Thanks you very much.
Now there is a programming:
----------xmbutton.c-------------------
#include <X11/Intrinsic.h>
#include <Xm/Xm.h>
#include <Xm/PushB.h>

void activateCB();
XmString btn_text;

int main(int argc, char * argv[]) {
Widget toplevel;
Widget mybutton;
XtAppContext app_context;
XFontStruct *font=NULL;
XmFontList fontlist=NULL;
char *namestring=NULL;

Arg args[10];
int n;

toplevel=XtAppInitialize(&app_context,"XMdemos",NULL,0,&argc,argv,NULL,NULL,0);
btn_text=XmStringCreateLocalized("中国北京"); /*中国北京 is a Chinese string.*/

n=0;
XtSetArg(args[n],XmNlabelString,btn_text);n++;
mybutton=XtCreateManagedWidget("button",xmPushButtonWidgetClass,toplevel,args,n);
XtAddCallback(mybutton,XmNactivateCallback,activateCB,NULL);

namestring="-adecw-screen-medium-r-normal--18-180-75-75-m-160-gb2312.1980-1"; /* this is a Chinese font */
font=XLoadQueryFont(XtDisplay(mybutton),namestring);
fontlist=XmFontListCreate(font,XmSTRING_DEFAULT_CHARSET);

n=0;
XtSetArg(args[n],XmNfontList,fontlist);n++;
XtSetArg(args[n],XmNwidth,250);n++;
XtSetArg(args[n],XmNheight,150);n++;
XtSetValues(mybutton,args,n);

XtRealizeWidget(toplevel);
XtAppMainLoop(app_context);
return 0;
}

void activateCB(Widget w,
caddr_t client_data,
caddr_t call_data)
{
printf("PushButton selected!\n");
}
---------------------------------------------------
I do:
#cc -o xmbutton xmbutton.c -L/usr/X11R6/lib -lXm -lXt -lX11
#./xmbutton
the result is not right.The string of button is "涓????含",not "中国北京".
I don't know the why.how can I do with my xmbutton.c?
thanks!


All times are GMT -5. The time now is 03:56 PM.