LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-06-2005, 09:06 AM   #1
gaoeh
LQ Newbie
 
Registered: Oct 2005
Posts: 17

Rep: Reputation: 0
Red face 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.
 
Old 12-07-2005, 01:56 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Make the changes you want in /etc/sysconfig/i18n
 
Old 12-07-2005, 01:57 AM   #3
T.Hsu
Member
 
Registered: Jan 2005
Posts: 178

Rep: Reputation: 31
/etc/sysconfig/i18n

You'd better to set locale to zh_CN.GBK, zh_CN is an alias to GB2312.
 
Old 12-07-2005, 05:04 AM   #4
gaoeh
LQ Newbie
 
Registered: Oct 2005
Posts: 17

Original Poster
Rep: Reputation: 0
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!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
problem "make"ing gtk+ "/usr/bin/env: perl -w" caid Linux - Newbie 8 07-29-2005 04:51 AM
Exception in thread "main" java.lang.InternalError: Can't connect to X11 window serve paragvd Programming 4 10-05-2004 03:35 AM
Java error "Exception in thread "main" java.lang.StackOverflowError" nro Programming 1 09-04-2004 03:47 AM
Exception in thread "main" java.lang.NoClassDefFoundError: Lobais Linux - Software 19 06-23-2004 08:42 AM
Exception in thread "main" java.lang.NoClassDefFoundError: melinda_sayang Programming 2 04-27-2004 11:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration