Question of the WeekDear globalwebmaster, How do I start an application in a terminal window using a different locale from the current desktop locale? globalwebmaster says, You can do this by emulating the CDE log in routine in a dtterm window, as described below. The processes that run when you log in to CDE include:
For information on starting the input method server, see /usr/dt/config/<locale>/0020.dtims,
which usually runs the /usr/openwin/lib/locale/<loicale>/imsscript/*
script if [ -x /usr/openwin/bin/htt -a -x /usr/lib/im/htt_xbe ]; then This starts the input method server, which loads each required language engine dynamically (if the system has the language engines). Below are the steps you need to follow. If you have logged in to CDE using the Unicode or UTF-8 locales and you want to start an application in the same locale, you can skip Step 2 (and in most cases Step 1 too). 1. Add the font paths for the locale you want (in the csh example): foreach i ( `cat /usr/openwin/lib/locale/<locale>/OWfontpath`
) (The xset fp rehash is probably not required, but it is a good idea after adding each font path.) 2. Start the input method server if your locale is an Asian or Unicode locale and has one or more of the script files at /usr/openwin/lib/locale/<locale>/imsscript/ directory. For example, the following command starts an input method server for the Japanese PCK locale with ATOK12 input system: setenv LANG ja_JP.PCK 3. Start the applications that will work with your locale choice, such as: env LANG=ja_JP.PCK dtterm & If you are running a non-Unicode/UTF-8 locale desktop and start a CDE Unicode/UTF-8 locale application, the fonts in the application and the desktop might not appear to match. This is because the fontset and fontlist definitions used by the CDE desktop locale are not the same as those used by the Unicode/UTF-8 locales. This is a cosmetic issue that will not hinder any Unicode/UTF-8 character processing or other operations. However, if the font display problem is serious enough, consider using a Unicode/UTF-8 locale desktop. When you specify a locale with setenv or env, make sure that the current shell's LC_ALL environment variable (and any other LC_* locale environment variable) are not set. If they are set, then specifying the "setenv LANG <locale>" or "env LANG=<locale>" would not take effect because the LC_* locale environment variables take precedence over the LANG locale environment variable. For more information on the locale environment variables, please see the setlocale(3C) man page.
Dear globalwebmaster, I am new to Java. How should I implement Unicode in my applications? globalwebmaster says, Unicode is Java's native character set. As such, Unicode is "built-in"
to the language. Creating an application that doesn't use Unicode would
require effort, while using Unicode comes at minimal or no expense at
all. Dear globalwebmaster, I have installed Solaris 9. However there is a bar underneath every
window saying "[English/European]". Why? How can I get rid of this?
POSIX globalwebmaster says, It appears that you have only installed only the listed locales.
You also probably selected the "en_US.UTF-8" locale as the default system
locale. Check in the Dear globalwebmaster, My Java application gets information from various outside processes
that might be running in various locales and on various UNIX or Windows
platforms; for example, from a database or web server. And these outside
processes might output their data in various encodings. The application
assumes the encoding of this outside information is in the system encoding
under which it is running; no encoding detection is attempted, so sometimes
the information displayed from these outside processes does not appear correctly
in the applications GUI. globalwebmaster says, The data format used for the data exchange should be specified?
A reasonably well specified system these days would either require all
data to be encoded in UTF-8, or use XML (where the standard specifies how
to detect the encoding), or specify some other way to communicate the character
encoding from data provider to consumer. Dear globalwebmaster, Is it true that with the distribution of JDK 1.3 there are no physical
fonts that support Asian characters? globalwebmaster says, The documentation is correct, in that the Lucida fonts in J2RE
1.3.x and 1.4.x don't include glyphs for Chinese, Japanese, or Korean.
It's also correct in saying that the logical font definitions on Microsoft
Windows™ include these fonts only
when running in a corresponding Windows locale.
Dear globalwebmaster, How do I install Cyrillic fonts on Solaris? What packages are required? Once installed, how do I access them? globalwebmaster says, Cyrillic fonts in Solaris 8 are in the following packages: pkgadd command.
The packages can be found on CD 1 of 2 (/cdrom/..../Solaris_8/Product)
If you have installed any of Russian locales (that is ru_RU.ISO8859-1,
ru_RU.KOI8-R, or ru_RU.ANSI1251), then the fonts are already on your
system. If you have installed any of Unicode locales, you will have at least SUNWi5rf. To use the fonts, you can login to one of the above locales or set your font paths in ~/.OWfontpath.
Dear globalwebmaster, I want to write applications that are able to display multiple language characters such as Chinese, Korean, Japanese. The app is running on Solaris base locale but the data could be other locale's data. Is there any way to display that data? globalwebmaster says, One way would be to do code conversion(s) by using iconv(3) functions
from the data in other locale/codeset to the current locale/codeset. There
is a possibility that the incoming data in other locale/codeset cannot be
represented by the current locale/codeset; in that case, running a UTF-8/Unicode
locale as the locale of the application would be a way and do code conversion
from all other locales/codesets to UTF-8/Unicode since UTF-8/Unicode
usually covers most characters being used.
Dear globalwebmaster, Which locale packages are needed to install the Japanese locale
on Solaris 8? globalwebmaster says, The package list for Japanese is availablehere. Adding packages: here.
Dear globalwebmaster, I'm working with NS4.78 on Microsoft Windows 2K. I have a utf-8
encoded page globalwebmaster says, It sounds as if you haven't specified the font for Unicode encoding.
You need to go to
Dear globalwebmaster, Our site is available in English and Spanish. Currently the user is greeted with a "Please select your language......." page. I know you can configure language preferences in the browser - but can you do anything with this on the server side? - like automatically serving up the correct language? globalwebmaster says, The browser sends the
Dear globalwebmaster, I have been unable to create a Java app with Thai letters. Can you help? globalwebmaster says, Thai support is only available with the latest J2SDK 1.4. Try following
sample code: Here is the result:
Dear globalwebmaster, I've been using the following code
-but setlocale always fails. Why?
globalwebmaster says, When using
Dear globalwebmaster, I have a ultra 10 box and I am using xlib/(c++) to render arabic (iso8859-6 encoded) strings on a image. globalwebmaster says,
Dear globalwebmaster, Is there any visual tool to efficiently resize the localized java application, by only altering the .java and the UIResBundle.properties files? Right now I am resizing manually (which is a shot in the dark) in .java source files in lines that look like : passwordLabel.setEnabled(false); And in the out-put resource UIResBundle.properties files in lines that look like: userSettingsGroupBox_passwordLabel_Text= Mot de passe : globalwebmaster says, Although there may be an IDE that can parse and visually represent source files, your situation is exactly what we try to avoid. Typically we can avoid hard-coding location and sizes by using well-managed layout managers. Usually a combination of layout managers and nested panels can create sophisticated layouts without resorting to setting exact pixel locations. So, although I don't have a good recommendation for you on this project, I do recommend making better use of layout managers in your next one.
Dear globalwebmaster, I want to write applications that are able to display multiple language characters such as Chinese, Korean, Japanese. The app is running on Solaris base locale but the data could be other locale's data. Is there any way to display that data? globalwebmaster says, One way would be to do code conversion(s) by using iconv(3) functions
from the data in other locale/codeset to the current locale/codeset.There
is a possibility that the incoming data in other locale/codeset cannot
be represented by the current locale/codeset; in that case, running
a UTF-8/Unicode locale as the locale of the application would be a way
and do code conversion from all other locales/codesets to UTF-8/Unicode
since UTF-8/Unicode usually covers most characters being used.
Dear globalwebmaster, How do I ensure that my Arabic text displays from right to left? What encoding should I use? Currently the browser output is garbled. globalwebmaster says, To view text in any language via a browser you must: You could encode an Arabic page in "iso-8859-6". Then in the HEAD
tag you should include: Of course you can always use "utf-8" encoding as is on the page http://www.columbia.edu/kermit/utf8.html. This page displays multiple languages and is a good page to test the unicode capabilities of your web browsers. Your should upgrade your browser to Netscape 6.2.2 or IE6. Both provide good unicode support. Around your Arabic text you should include this: Dear globalwebmaster, I need to build a Japanese Search Engine using Java. However, I am unable to compare Japanese Strings with each other. I have attempted using Unix programming as well as JBuilder. But have yet met with success. I'm trying to convert the native code over to Unicode first, then compare the Unicode strings. Do you have any advice on this?
globalwebmaster says,
The Java platform provides the
Dear globalwebmaster, How do I type keyboard shortcuts - composite characters - on Solaris using a PC keyboard that does not have Compose or Alt Graph keys?
globalwebmaster says,
The alternative key sequence for the Compose key is Ctrl-Shift-T
(press the Control, Shift, and T keys simultaneously).
May 2003 |
| |||||||||||||||||||||||||
|
| ||||||||||||