SUMMARY: Composition of foreign language characters

From: Rubens Queiroz de Almeida - Ramal 8267 (
Date: Thu Oct 01 1992 - 14:39:22 CDT

Here is my original query:

        My applications require the use of foreign language characters
        which can be formed by pressing the <compose> key and the desired
        set of keys. But this doesn't always work.
        It sometimes does work and
        sometimes it doesn't. I use the command "stty -istrip" so that the
        eigth bit isn't discarded. I also use "stty -cs8". These procedures
        have been recommended to me, but they don't work either.

I would like to thank the following people for having helped
me solve my problem:

Guy Harris - <>
Claude-Marie Sauve - <claudie@CANR.Hydro.Qc.CA>
Matthew Donaldson - <>
Alain Brossard - <>
Birger A. Wathne - <>

All the answers were similar in content. I am enclosing
here the answer I received from Mr. Birger A. Wathne
which is very complete and provided me with very useful


This text i Copyrighted.
Distribute freely, but do not alter it.
My reason for doing this is that i want all comments to get back to me,
so i can be sure *i* have the latest, greatest version.

(C) Birger Wathne, Skrivervik Data A/S, 1992

Version 1.01

Birger A. Wathne S K R I V E R V I K Skrivervik Data A/S
                          +-------------------+ Thormoehlensgt. 55
email: | D A T A| N-5008 BERGEN
                          +-------------------+ Tel: +47 5 543740
                                                  Fax: +47 5 322853


This is a simple intro to using 8-bit characters on a Sun system.
Some of this should be portable to other environments.

Letting 8-bit characters through:
The tty drivers often strip the 8'th bit from characters passing

Add the lines

stty cs8 pass8 # cs8 = character size is 8 bit
                             # pass8 = let 8-bit characters through

to your .cshrc file

Defining character set:

Applications written to the ANSI C spec should be able to use
an environment variable called LC_CTYPE to determine which character
set you want to use.

On Sun's the only implemented options so far are "c" and "iso_8859_1",
although you can define your own if you wish to do so.

LC_CTYPE defines much more than the character set. Try the command
'man locale' to see if your system implements it.
The default on Sun is the "c" locale. 8-bit characters are undefined
in this locale, so most eupropean users should set it to iso_8859_1.

Add the foolowing line to your .login file:

setenv LC_CTYPE iso_8859_1 # Define ANSI locale

With these additions, most SunOS commands should work with
8-bit characters. 'ls' will show filenames with 8-bit characters, etc.

Some programs need some more work. 'xterm' is one of these.
You have to specify some resources to make it use ISO conforming
fonts. I have also found one version that needed a resource to be set
to enable 8-bit input.

--------------------------- .Xdefaults ---------------------------------

!Resources for xterm. Should reside in $HOME/.Xdefaults or in a file
!called XTerm somewhere in your $XAPPLRESDIR or $XUSERFILESEARCHPATH
!The EightBitInput resource may be obsoleted by now?
XTerm*EightBitInput: true
!Use only ISO 8859-1 (ISO latin 1) fonts
XTerm*VT100*font: -adobe-courier-medium-r-normal--12-120-75-75-m-70-iso8859-1
XTerm*SimpleMenu*font: 8x13
XTerm*SimpleMenu*menuLabel.font: 8x13bold
XTerm*fontMenu*font1*Label: Small
XTerm*VT100*font1: -adobe-courier-medium-r-normal--10-100-75-75-m-*-iso8859-1
XTerm*fontMenu*font2*Label: Bold normal
XTerm*VT100*font2: -adobe-courier-bold-r-normal--12-120-75-75-m-*-iso8859-1
XTerm*fontMenu*font3*Label: Italic normal
XTerm*VT100*font3: -adobe-courier-medium-o-normal--12-120-75-75-m-*-iso8859-1
XTerm*fontMenu*font4*Label: Bold large
XTerm*VT100*font4: -adobe-courier-bold-r-normal--18-180-75-75-m-110-iso8859-1
!Misc settings (Not needed for 8-bit to work)
#ifdef COLOR
XTerm*pointerColor: red
XTerm*ScrollBar: true
XTerm*reverseWrap: true
XTerm*saveLines: 256
XTerm*vt100.Geometry: 80x40


How to write 8-bit characters:

If you have a national keyboard, you already know how to write those....
You can also set up function keys, etc. Use the program 'xev' to find
the names of the function keys, and 'xmodmap' to set up your own definitions.
If you save the following 3 lines to a file called $HOME/.xmodmap.nor.sun4
and run 'xmodmap $HOME/.xmodmap.nor.sun4', you will get the norwegian
special characters on the R4, R5 and R6 keys of a Sun4 keyboard.

keysym F24 = ae
keysym F25 = oslash
keysym F26 = aring

The 'compose'-key:

The key labeled 'Compose' on the Sun keyboard is a powerful tool.
If you need to write 8-bit characters, you should learn how to use this feature.

It is available in *all* X clients if they are dynamically linked,
and run in Sun's OpenWindows environment. For the technically interested,
it is built into Sun's file, so $OPENWINHOME/lib should
appear first in your LD_LIBRARY_PATH variable.
There is also a patch available for MIT X11R4 and possibly X11R5 to enable
this feature.

Some examples of the 'Compose'-key functionality:
Compose e ' -> eacute
Compose A E -> aeligature
Compose O / -> oslash
Compose n ~ -> ntilde

To use the compose key on other X servers (X terminals, PC's, etc):
1) Find a suitable key (I use the option-key on the NCD keyboards,
   to use this key, ensure DECwindows compatibility is off)
2) Run 'xev', move the pointer into the window, and press your key.
3) Find the 'keycode' returned ('Option' on NCD unix on a 15b: 89)
4) Issue the command 'xmodmap -e "keycode 89=Multi_Key"'


This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:06:50 CDT