International Language Environments Guide

TTY Environment Setup

Depending on the terminal and terminal emulator that you are using, you might need to push certain code set-specific STREAMS modules onto your streams.

For more information on STREAMS modules and streams in general, see the STREAMS Programming Guide.

The following table lists the 64–bit STREAMS modules supported by the en_US.UTF-8 locale in the terminal environment. For more details, see the Oracle Solaris 64–bit Developer's Guide.

Table 5–1 STREAMS Modules Supported by en_US.UTF-8

32-bit STREAMS module 

Description 

/usr/kernel/strmod/sparcv9/u8lat1

Code conversion STREAMS module between UTF-8 and ISO8859-1 (Western European)

/usr/kernel/strmod/sparcv9/u8lat2

Code conversion STREAMS module between UTF-8 and ISO8859-2 (Eastern European)

/usr/kernel/strmod/sparcv9/u8koi8

Code conversion STREAMS module between UTF-8 and KOI8-R (Cyrillic)


Note –

Starting with the Oracle Solaris 10 release, the 32-bit kernel is no longer supported for the SPARC platform. Table 5–1 applies only to the 32-bit kernel for the x86 platform. For more details, refer to the Release Notes.


The following table lists the 64–bit STREAMS modules supported by en_US.UTF-8.

Table 5–2 64–bit STREAMS Modules Supported by en_US.UTF-8

64-bit STREAMS Module 

Description 

/usr/kernel/strmod/sparcv9/u8lat1

Code conversions STREAMS module between UTF-8 and ISO8859-1 (Western European)

/usr/kernel/strmod/sparcv9/u8lat2

Code conversions STREAMS module between UTF-8 and ISO8859-2 (Eastern European)

/usr/kernel/strmod/sparcv9/u8koi8

Code conversions STREAMS module between UTF-8 and KOI8-R (Cyrillic)

ProcedureHow to Load a STREAMS Kernel Module

  1. As the root user, determine whether you are running a 64-bit Oracle Solaris or 32-bit Oracle Solaris system.

    system# isainfo -v
    • A 64—bit Oracle Solaris system returns the following information:

      64-bit sparcv9 applications
      32-bit sparc applications
    • A 32—bit Oracle Solaris system returns the following information:

      32-bit sparc applications
    • A 32—bit x86 system returns the following information:

      32-bit i386 applications
  2. Determine whether your system has already loaded the STREAMS module.

    system# modinfo | grep modulename
    

    If the STREAMS module, such as u8lat1, is already installed, the output looks as follows:

    system# modinfo | grep u8lat1
    89 ff798000  4b13  18   1  u8lat1 (UTF-8 <--> ISO 8859-1 module)
  3. If the module has not already been loaded, load it using the modload(1M) command.

    • On a 32—bit system, you would type:

      system# modload /usr/kernel/strmod/u8lat1
    • On a 64—bit system, you would type:

      system# modload /usr/kernel/strmod/sparcv9/u8lat1

      The appropriate u8lat1 STREAMS module is loaded in the kernel. You can now push it onto a stream.

ProcedureHow to Unload a STREAMS Kernel Module

  1. As root, verify that the kernel module is loaded.

    For example, to verify the u8lat1 is loaded, you would type:

    system# modinfo | grep u8lat1
    89 ff798000  4b13  18   1  u8lat1 (UTF-8 <--> ISO 8859-1 module)
  2. Use the modunload(1M) command to unload the kernel.

    For example, to unload the u8lat1 module, you would type:

    system# modunload -i 89

ProcedureHow to Setup a Latin-2 Terminal and STREAMS Module

  1. Use the strchg(1M), as shown in the second command line

    system% cat > tmp/mystreams 
    ttcompat
    ldterm
    u8lat1
    ptem
    ^D
    system% strchg -f /tmp/mystreams

    Be sure that you are either root or the owner of the device when you use strchg(1).

  2. Run the strconf command to examine the current configuration.

    system% strconf
    ttcompat
    ldterm
    u8lat1
    ptem
    pts
    system%
  3. Run the strchg command to reset the original configuration.

    system% cat > /tmp/orgstreams
    ttcompat
    ldterm
    ptem
    ^D
    system% strchg -f /tmp/orgstreams

dtterm, xterm and Terminals Capable of Input and Output of UTF-8 Characters

Unlike the older releases of the Oracle Solaris operating system, the dtterm and xterm terminal emulators and any other terminals that support input and output of the UTF-8 code set, do not need to have any additional STREAMS modules in their streams. The ldterm module is now codeset independent and supports Unicode/UTF-8 if you set up the terminal environment with the stty(1) utility.

To set up the proper terminal environment for the Unicode locales, use the stty(1) utility.

system% /bin/stty defeucw

To query the current settings, use the -a option of the stty utility, as shown below:

system% /bin/stty -a

Note –

Because /usr/ucb/stty is not internationalized, use /bin/stty instead.


Terminal Support for Latin-1, Latin-2, or KOI8-R

For terminals that support only Latin-1 (ISO8859-1), Latin-2 (ISO8859-2), or KOI8-R, you should have the following STREAMS configuration:

head <-> ttcompat <->  ldterm <->  u8lat1 <-> TTY

This configuration is only for terminals that support Latin-1. For Latin-2 terminals, replace the STREAMS module u8lat1 with u8lat2. For KOI8-R terminals, replace the module with u8koi8.

Make sure you already have the STREAMS module loaded into the kernel.

Saving the Settings in ~/.cshrc

Assuming the necessary STREAMS modules are already loaded with the kernel, you can save the following lines in your .cshrc file (C shell example) for convenience:

setenv LANG en_US.UTF-8
if ($?USER != 0 && $?prompt != 0) then
     cat >! /tmp/mystreams$$ << _EOF
     ttcompat
     ldtterm
     u8lat1
     ptem
_EOF
     /bin/strchg -f /tmp/mystreams$$
     /bin/rm -f /tmp/mystreams$$
     /bin/stty cs8 -istrip defeucw
endif

With these lines in your.cshrc file, you do not have to type all of the commands each time you use the STREAMS module. Note that the second _EOF should start from the first column of the file.