Question & Answer
Question
We would like to run Communications Server for Linux (CS Linux) 6.2.1 on RedHat Enterprise Linux 4 with Japanese language environment, which has ja_JP.UTF-8 as the default code. There are three common Japanese language codes: Universal Transformation Format, 8-bit Form (UTF-8), Extended UNIX Code (EUC), and Shift-Japanese Industrial Standard (SJIS), but it seems that CS Linux only supports EUC. We have changed the LANG variable to those three codes, but only EUC is readable. Q1. Does CS Linux support ja_JP.UTF-8? Q2. If so, how do we change the code from EUC to UTF-8? Q3. If CS Linux only supports EUC, what is the best alternative way? Should we start and stop CS Linux after setting the variable LANG=en_US and make it write all the messages to console/logs in English so they are readable in both UTF-8 and EUC language environments?
Answer
Q1 & Q2. Does CS Linux support ja_JP.UTF-8? If so, how do we change the code from EUC to UTF-8?
A1 & A2. CS Linux supports one Japanese locale. The Japanese code page CS Linux supports on Linux is the ja_JP.eucjp.
The CS Linux code will start with that Japanese locale if the $LANG setting starts with "ja_JP", so you get the same CS Linux code page whether $LANG is set to ja_JP.eucjp or ja_JP.utf8.
Q3. If CS Linux only supports EUC, what is the best alternative way? Should we start and stop CS Linux after setting the variable LANG=en_US and make it write all the messages to console/logs in English so they are readable in both UTF-8 and EUC language environments?
A3. You can run CS Linux in English by choosing either of the following options:
Option 1:
- set export LANG=en_US in the /etc/init.d/*/snastart script
- set aliases as follows:
- # LANG=en_US /opt/ibm/sna/bin/snaadmin
- # LANG=en_US /opt/ibm/sna/bin/xsnaadmin
- set up alias for any applications you run. In this case the alias will look as follows:
- alias snaadmin='LANG=en_US /opt/ibm/sna/bin/snaadmin'
Option 2:
- Remove the CS Linux ja_JP files. This forces CS Linux to only use English because it will not be able to find the ja_JP message text. Do the following each time CS Linux is installed or updated:
- rpm -q -l ibm-commserver | grep JP
rm /opt/ibm/sna/help/ja_JP/*
rmdir /opt/ibm/sna/help/ja_JP
rm /opt/ibm/sna/lib/nls/msg/ja_JP/*
rmdir /opt/ibm/sna/lib/nls/msg/ja_JP
rm /usr/X11R6/lib/X11/ja_JP/app-defaults/XSnaadmin*
The different parts of CS Linux can run with different locales at the same time. For example, the snastart script can set LANG=en_US and one user can start an xsnaadmin GUI with a second LANG value and another user can run a snaadmin command line with a third LANG value and an application can do CS Linux calls with a fourth LANG value, all at the same time. Since all four of those processes can write to the /var/opt/ibm/sna/sna.err (and related) files, you may see entries in that file from multiple LANGs. That is why the numeric codes in those entries are important, so that a message written to that file in one LANG can be interpreted or displayed in another using the following:
- # export LANG=xx_XX
# snahelp yyyy-zzz
where yyyy-zzz is that numeric code on the sna.err entry.
This also extends to other parts of the Linux operating system. If CS Linux only runs en_US, then the Linux kernel can still use ja_JP and both write to /var/log/messages.
If the LANG environment variable is ja_JP.UTF8, it will not render properly. You can convert the /var/opt/ibm/sna.err or .../sna.aud file from the "eucjp" to "UTF-8" by using the common convert tool, "iconv". On Linux, issue the following to convert the error log from eucjp to UTF-8:
# iconv -f EUCJP -t UTF-8 -o sna_UTF8.err sna.err
Note that UTF-8 is double byte, so it takes about 70% more space. If a file is 50000 bytes, it will be more like 85000 bytes in UTF format.
But keep in mind that the sna.err file could have entries in multiple LANGs at the same time. The iconv example assumes the whole entire file is in one code page and is being converted to another code page. That may not always be true.
The X-Windows will render it properly for using xsnaadmin. So, if the locale is "ja_JP.eucjp" or "ja_JP.UTF8" and you issue "xsnaadmin", this will render the proper Japanese fonts for the GUI.
For more information see section 5.1.3 Setting the Language Environment Variable in:.
Also see the IBM Technote Changing fonts used for Motif Administration Utility xsnaadmin.
Was this topic helpful?
Document Information
Modified date:
02 August 2018
UID
swg21240253