Operating System - HP-UX
1748213 Members
2936 Online
108759 Solutions
New Discussion юеВ

Re: How to change locale?

 
Srimalik
Valued Contributor

How to change locale?


Hi,

How can I change the locale on a HP-UX machine.
My current settings are:
bash-2.05# locale
LANG=
LC_CTYPE="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_MESSAGES="C"
LC_ALL=
bash-2.05#

I want them to change it to ja_JP.SJIS.

The contents of /usr/lib/locale are:
bash-2.05# ls /usr/lib/locale/
en_US
bash-2.05#
(do I have to install extra lang packages also on my machine)

What all thing I need to do to set the locale to ja_JP.SJIS.?

Thanks
-Sri
abandon all hope, ye who enter here..
10 REPLIES 10
singvey
Frequent Advisor

Re: How to change locale?

try it pls :
setlocale(xxxxxxx, "xxxxxx");
Srimalik
Valued Contributor

Re: How to change locale?

I don't want to do it in a program.

Is there some config file to change the system locale?
abandon all hope, ye who enter here..
AwadheshPandey
Honored Contributor

Re: How to change locale?

http://techsolutions.hp.com/en/5971-2270/ch03s01.html
It's kind of fun to do the impossible
Dennis Handly
Acclaimed Contributor

Re: How to change locale?

To change the locale, you simply export LANG=ja_JP.SJIS.

You can do this is each .profile, or put it in the system wide one /etc/profile.

>do I have to install extra lang packages also on my machine

You may have to do that. What does "locale -a" show?

Does this show anything?
$ swlist -l product International
Srimalik
Valued Contributor

Re: How to change locale?

After doing this also , it seems that there is something un-configured

When I execute some command the messags are not geeting displayed in Japanese.
for eg.

#list a non existing path.

bash-2.05# ls /opt/sfdsdfsdfs
/opt/sfdsdfsdfs ├В┬к├Г ├Г ├В┬й├Г┬и├Г ├В┬╣├Г┬▒B
bash-2.05#

The error message(/opt/sfdsdfsdfs not found) is not in japanese).

Am i missing something?



abandon all hope, ye who enter here..
Srimalik
Valued Contributor

Re: How to change locale?

I am conneting to the server using putty...do I need anything special on the client side?
abandon all hope, ye who enter here..
Dennis Handly
Acclaimed Contributor

Re: How to change locale?

>The error message(/opt/sfdsdfsdfs not found) is not in japanese). Am i missing something?

It doesn't look like American Nerd, so it must be something else, maybe Greek. ;-)

If you use tusc, you can see if it opens the Japanese message catalog. If so, it is Japanese. Of course your display may not display it correctly. Do you strip parity?

Here is the raw dump of what I get:
$ LANG=ja_JP.SJIS ls xxxXXXXXXXXXXXX 2> ls.out
$ vis ls.out
xxxXXXXXXXXXXXX \202\252\202\335\202\302\202\251\202\350\202\334\202\271\202\361
\201B

In my case, tusc said it opened:
open("/usr/lib/nls/msg/ja_JP.SJIS/ls.cat", O_RDONLY, 014) = 6
Dennis Handly
Acclaimed Contributor

Re: How to change locale?

>I am connecting to the server using putty... do I need anything special on the client side?

I assume that side has to know you are using Japanese too??
Srimalik
Valued Contributor

Re: How to change locale?

it worked when I connect to the HP-UX server from another linux machine and the same LANG exported on client terminal.
abandon all hope, ye who enter here..