Simplified Chinese Solaris User's Guide

Part III System Administrator Information

This part includes system administrator information.

Chapter 7 Configuring a Simplified Chinese Solaris System

You can use the procedures this chapter to set a system-wide default locale or to add a new locale from the Solaris DVD and CD media. You also change the font path set by the Xsession script included in the Simplified Chinese Solaris Operating System. The following sections are included in this chapter.

Setting the Default Locale

You can make a system-wide change to the default locale with the following procedure.

How to Set the Default Locale

  1. Become superuser.

  2. Edit the /etc/default/init file.

  3. Add or update the LANG variable with the appropriate locale.


    LANG=locale
    

    You can set the LANG variable with one of the following locales: zh, zh.GBK, zh_CN.GB18030, zh.UTF-8

  4. Instruct all users to exit CDE.

  5. Kill the dtconfig process.


    # /usr/dt/bin/dtconfig -kill
    
  6. Reboot the system.


    # reboot
    

Using Aliases to Set the Locale

You can use aliases to change locales in a terminal window without typing long command lines or editing your .dtlogin file and running source every time.

How to Set Locale Aliases for the Korn Shell

  1. Put aliases such as the following in your .profile file.


    alias chn "export LANG=zh; /bin/stty cs8 -istrip defeucw"
    alias chn_GBK "export LANG=zh.GBK; /bin/stty cs8 -istrip \defeucw"
    alias asc "export LANG=C; /bin/stty cs7 istrip defeucw"
    alias chn "export LANG=zh; /bin/stty cs8 -istrip defeucw"

How to Set Locale Aliases for the C Shell

  1. Put aliases such as the following in your .cshrc file.


    alias chn_EUC "setenv LANG zh; /bin/stty cs8 -istrip defeucw"
    alias chn_GBK "setenv LANG zh.GBK; /bin/stty cs8 -istrip \defeucw"
    alias asc "setenv LANG C; /bin/stty cs7 istrip defeucw"
    alias chn_UTF-8 "setenv LANG=zh.UTF-8; /bin/stty cs8 -istrip defeucw"

Chapter 8 Managing the htt Input Method Server

This chapter describes the basic display features of the input method server. The input method server (IM server) handles Simplified Chinese input for Simplified ChineseSolaris software. The IM server receives keyboard input and makes the input available as Simplified Chinese characters to Simplified Chinese Solaris applications. The IM server can serve any internationalized X Window application that uses X Window Input Method (XIM) application program interfaces (API) to receive language input.

The following sections of this chapter explain the basic display features of the IM Server.

Input Method Server Basic Properties

The Simplified Chinese Solaris Operating System starts the IM server automatically when you start the Simplified Chinese in a locale that requires an input method. The IM server continues to run and service applications that are started and connected to it.

Simplified Chinese Solaris applications that use the IM server for Simplified Chinese character input typically find the IM server running when they start. To user the IM server's service for language input, the IM server should be running before an application is started. If the IM server is not running when an application is started, the application might not be able to get the input service even if IM server is started later.

Three htt Processes

The input method server comprises three related processes running together. The processes are htt, htt_xbe, and htt_server. One process controls the input method server properties, another controls the population of the input method server (that is, a “watchdog” process), and the third handles input methods of clients.

Usually, you don't need to know the details of these three processes. When htt is started, htt_xbe and htt_server are started automatically.

htt Application Display

The following figure shows a typical application display when using the htt input method.

The preceding context describes the graphic.

How and When htt Is Started

The htt process must be running before an application starts in order for the application to use the htt input method server to receive Simplified Chinese input. The C locale does not require htt. If you change the default locale from C to another locale that requires htt, you must start htt in same terminal window. You can start htt with a command such as the one shown in the following example.


system% /usr/openwin/bin/htt -if twle -xim htt_xbe &

When the locale is set tozh, htt is started automatically when the Simplified Chinese windowing environment starts. In CDE, htt is started from the /usr/dt/config/Xsession.d/0020.dtims script. This script is executed by Xsession, which runs at every initialization stage upon a user's login from dtlogin. This script ensures that htt is started before other applications in CDE.

Using the iiim Server in zh.UTF-8 and zh_CN.UTF-8 Locales

The Internet Intranet Input Method Server (iiim) supports the European Local Input Methods that use the Compose Key. The iiim server supports the Asian Remote Input Methods using IIIM Protocol. The default Language Engine is English/European which supports ASCII and some European Languages such as German and French.

To switch to Chinese input methods, press Control-spacebar.

To switch to other language engines, click the left mouse button in the status area.

The following language engine list appears:

The following language engines appear if their corresponding locales are installed:

After the Simplified Chinese language engine is selected, you can use the following function keys to switch between different input methods:

For more detailed information about Input Methods, see Chapter 4, Entering Simplified Chinese Text.

Chapter 9 Fonts

This chapter describes the PostScript, TrueType and bitmap fonts supported for use in the Simplified Chinese Solaris Operating System. The following sections discuss how to use and to edit the fonts.

Display PostScript System (DPS)

The Simplified Chinese Solaris Operating System provides PostScript fonts in the Display PostScript System (DPS). This section describes the fonts and the DPS facilities. For further details, see Programming the Display PostScript System with X, published by Adobe® Systems.

Using Simplified Chinese PostScript Fonts and DPS Facilities

The Simplified Chinese Solaris Operating System includes the fonts listed in the following table.

Table 9–1 Simplified Chinese Solaris Operating System PostScript Fonts

Font Name 

Description 

Song-Medium 

Alias of Song-Medium-EUC; can be used like a Roman font. 

Song-Medium-EUC 

Song-Medium font, EUC encoding, horizontal display; can be used like a Roman font. 

Kai-Medium 

Alias of Kai-Medium-EUC; can be used like a Roman font. 

Kai-Medium-EUC 

Kai-Medium font, EUC encoding, horizontal display; can be used like a Roman font. 

FangSong-Medium 

Alias of FangSong-Medium-EUC; can be used like a Roman font. 

FangSong-Medium-EUC 

FangSong-Medium font, EUC encoding, horizontal display; can be used like a Roman font. 

Hei-Medium 

Alias of Hei-Medium-EUC; can be used like a Roman font. 

Hei-Medium-EUC 

Hei-Medium font, EUC encoding, horizontal display; can be used like a Roman font. 

The following figure shows a sample of the Song-Medium font.

The preceding context describes the graphic.

Creating Composite Roman and Simplified Chinese Fonts

You can create composite fonts using any a Roman font and any of the Simplified Chinese fonts. For example, the following PostScript code defines a composite font, Times-Italic+Kai-Medium. The Times-Italic is used for the ASCII characters and Kai-Medium font is used for the Simplified Chinese characters.

/makeEUCfont {
        /AsianFont exch def
        /WestFont  exch def
        /NewFont   exch def

        /CIDInit /ProcSet findresource 
        begin
          NewFont [ AsianFont WestFont ]
          beginrearrangedfont
            1 usefont
            1 beginbfrange
              <00> <7e>  <00>
            endbfrange
          endrearrangedfont
        end
  } bind def

  /LC_Times-Roman /Times-Roman /Kai-Medium makeEUCfont

Using Simplified Chinese Fonts in DPS Programming

You can use Simplified Chinese fonts just as you use Roman fonts in DPS wrap definitions. The following code sample creates the display in the Hello World figure.

	defineps PSWDisplayText(char *text)
        	/pointSize 50 def
        	/Helvetica pointSize selectfont
        	(Hello World) stringwidth pop 2 div neg 0 moveto
        	(Hello World) show
	
        	/cpSize 40 def
        	/Song-Medium cpSize selectfont
        	(text) stringwidth pop 2 div neg pointSize neg moveto
        	(text) show
	endps

You can call PSWDisplayText(Chinese text) in a C program to display the designated Chinese text.

Window shows the text Hello World in English and in Simplified Chinese characters.

The Simplified Chinese Solaris software provides TrueType support in DPS.

BDF to PCF Conversion

You must convert BDF fonts to PCF format to make the fonts usable in Simplified Chinese Solaris applications.

How to Convert BDF Fonts to PCF Format

  1. Use the bdftopcf command to convert a BDF font to PCF format.


    system% bdftopcf -o myfont14.pcf myfont14.bdf
    
  2. Replace the BDF file in the following directory with the converted PCF file: $OPENWINHOME/lib/locale/locale-name/fonts

How to Install and Check the Edited Font

  1. Compress the .pcf font file and move it to your font directory.


    system% compress myfont14.pcf
    
  2. Run the following commands in your font directory.

    The .bdf file should not be in the font directory.


    system% cat >> fonts.alias
    -new-myfont-medium-r-normal--16-140-75-75-c-140-gb2312.1980-0
    Myfont-Medium14
    ^D
    system% mkfontdir
    system% xset +fp `pwd`
    
  3. Use a command line such as the following to view your font.


    system% xfd -fn Myfont-Medium14
    

All Simplified Chinese fonts have XLFD font names. You can use the xlsfonts utility to display the font names.


system% xlsfonts | grep gb2312

Creating Characters With sdtudctool

The sdtudctool utility supports bitmap, Type 1, and CID fonts. This section contains instructions for using the sdtudctool to create, input, and print new characters for the Simplified Chinese locales in the following code ranges.

Table 9–2 Code Points for Locales

Locale 

Code Ranges 

zh 

0xD7FA-0xD7FE 

zh.GBK 

0xA140-0xA7A0 

0xAAA1-0xAFFE 

0xF8A1-0xFEFE 

zh_CN.GB18030 

0xA140-0xA7A0 

0xAAA1-0xAFFE 

0xF8A1-0xFEFE 

How to Use the sdtudctool

You can use the following procedure to create characters in the zh locale.

  1. To start the utility, type the following command:


    system% sdtudctool
    

    The following window appears.

    The preceding context describes the graphic.
  2. Click the Character button.

    The following dialog box appears:

    The preceding context describes the graphic.
  3. Specify the code position of the new character.

  4. Create the outline or bitmap for the character using the drawing tools.

  5. Click save from the file menu to save the character.

    The new character(s) are saved in $HOME/.Xlocale/{locale}/fonts/UDC..

How to Specify sdtudctool Options

  1. Choose options from the file menu.

    The options dialog box appears.

    The preceding context describes the graphic.
  2. Turn on the append font path option to append the UDC font aliases to your font path.

  3. Turn on save font path option to add the font files to the system font path.

    The new font files located in $HOME/.Xlocale/{locale}/fonts/UDC) will be listed in the $HOME/.OWfontpath file and made available to the X server the next time you log in.

    If Save Font Path is off, the font files will still be saved in $HOME/.Xlocale/{locale}/fonts/UDC, but will not be added to the system fontpath the next time you log in.

  4. Choose one or more of the following point sizes for the bitmap fonts: 12, 14, 16, 20, 24.

How to View a Character Reference

  1. To view the character reference, click the icon below the help menu.

    The following window appears.

    The preceding context describes the graphic.
  2. To close the window, click the icon again.

How to Register the UDC to the NewPinYin Input Method

  1. Choose save from the file menu or choose the open dictionary tool option from the file menu. The sdtudc_register tool panel appears.

    The preceding context describes the graphic.
  2. Input the PinYin in the reading column.

    The preceding context describes the graphic.
    Note –

    The only the valid PinYin can be registered to NewPinyin input method.


  3. Click Confirm button

    The following dialog box appears.

    The preceding context describes the graphic.
  4. The UDC and its PinYin will be registered in /var/tmp/newpyudc.txt. Click OK in the dialog to confirm

How to Type the New Characters

Use the NewPinyin or NeiMa input method to type the UDC's PinYin spelling for the characters you create.

  1. Type shan in NewPinyin mode.

    The preceding context describes the graphic.
  2. Type D7FA in GB NeiMa mode.

    The preceding context describes the graphic.

How to Print the New Characters

  1. Set the fontpath for mp utility.


    system% setenv UDC_BASE $HOME/.Xlocale/zh
    
  2. Print a text file which contains UDCs by specifying the configuration file for UDC.


    system% /usr/openwin/bin/mp -u/usr/lib/lp/locale/zh/mp/mp.conf.U\
     udc.txt > udc.ps
    

Changing Font Directories

The Xsession script in the /usr/dt/bin directory includes the following font path: /usr/openwin/lib/locale/locale/X11/fonts, where locale is either zh, zh.GBK, or zh_CN.GB18030. To dynamically add a different font directory path, type the following commands.


system% xset +fp font_directory-path
system% xset fp rehash

How to Add a Font Directory Path

    Before using the xset command, ensure that the fonts.dir file exists in the specified font directory. If fonts.dir does not exist, use mkfontdir to create the fonts.dir for the Bitmap font.

    Type the following commands to dynamically add a different font directory path.


    system% xset +fp font_directory-path
    system% xset fp rehash
    

Bitmap and TrueType Fonts

The tables in this section list the TrueType and bitmap fonts that are available for the zh_CN.EUC, the zh_CN.GBK, and the zh_CN.GB18030 locales.

The following table shows the TrueType fonts for the zhlocale.

Table 9–3 TrueType Fonts for the zh_CN.EUC Locale

Full Family Name 

Subfamily 

Format 

Vendor 

Encoding 

 Fangsong R TrueType Hanyi GB2312.1980
 Hei R TrueType Monotype GB2312.1980
 Kai R TrueType Monotype GB2312.1980
 Song R TrueType Monotype GB2312.1980

The following table shows the bitmap fonts for the zh locale.

Table 9–4 Bitmap Fonts for the zh_CN.EUC Locale

Full Family Name 

Subfamily 

Format 

Encoding 

 Song B PCF (14,16) GB2312.1980
 Song R PCF (12,14,16,20,24) GB2312.1980

Table 9–5 TrueType Fonts for the zh_CN.GBK Locale

Full Family Name 

Subfamily 

Format 

Vendor 

Encoding 

 Fangsong R TrueType Zhongyi GBK
 Hei R TrueType Zhongyi GBK
 Kai R TrueType Zhongyi GBK
 Song R TrueType Zhongyi GBK

The following table shows the bitmap fonts for the zh_CN.GBK locale.

Table 9–6 Bitmap Fonts for the zh_CN.GBK Locale

Full Family Name 

Subfamily 

Format 

Encoding 

 Song R PCF (12,14,16,20,24) GBK

The following table shows the TrueType fonts for the zh_CN.GB18030 locale.

Table 9–7 TrueType Fonts for the zh_CN.GB18030 Locale

Family Name 

Subfamily 

Format 

Vendor 

Encoding 

FangSong 

TrueType 

FangZheng 

GB18030–2000 

Song 

TrueType 

FangZheng 

GB18030–2000 

Hei 

TrueType 

FangZheng 

GB18030–2000 

Kai 

TrueType 

FangZheng 

GB18030–2000 

The following table shows bitmap fonts for the zh_CN.GB18030 locale.

Table 9–8 Bitmap Fonts for the zh_CN.GB18030 Locale

Family Name 

Subfamily 

Format 

Encoding 

Song 

PCF(12,14,16,20,24) 

GB18030–2000 

Chapter 10 Simplified Chinese Printing Facilities

This chapter describes how to print Simplified Chinese text to a line printer. The chapter also provides information on how to use the mp utilities to print to a PostScript printer or to a line printer.

Printing Chinese Output From a Command Line

This section provides information that you can use to print from a command line with the lp command and the mp program.

Printing With a Line Printer

You can use the commands in this section to print files of different formats to a line printer.

    Use this command to print an EUC file.


system% lp EUC_filename 

    Use this command to print a GB format file to a printer that supports GB format.


    system% lp -T GB GB_filename 
    

Printing With the mp Utility

The enhanced mp print utility is available in the current Simplified Chinese Solaris release. You can use mp to print zh files in zh locale or UTF-8 files in zh.UTF-8 locales.

The output from the utility is standard PostScript that you can send to any PostScript printer.

Use the following command to print a file with the mp utility.


system% mp filename | lp

You can also use the utility as a filter because mp accepts stdin stream.


system% cat filename | mp | lp

You can set the utility as a print filter for a line printer. For example, the following command sequence signals the print service that the printer lp1 accepts only mp format files. The command also installs the printer lp1 on port /dev/ttya. See the lpadmin(1M) man page for more details.


system% lpadmin -p lp1 -v /dev/ttya -I MP
system% accept lp1
system% enable lp1 

You can use the following command to add a filter for an LP print service.


system% lpfilter -f filtername \
-F pathname

The filter converts the default input type to PostScript output with the /usr/bin/mp command.

To print a UTF-8 text file, use a command line such as the following.


system% lp -T MP UTF-8-file

For more details on the mp(1), see the man page.

Using mp as an Xprt (X Print Server) Client

Using mp as an Xprt client enables mp to print the output of any printer connected to a network supported by an Xprt print service. As an Xprt client, mp supports PostScript and many versions of PCL.

The Xprt client attempts a connection to an Xprt server based on the following rules:

Chapter 11 TTY Environment and Support

This chapter assumes that you are familiar with the following information.

This chapter includes the following sections:

Refer to the termio(7I)man page for background information on STREAMS and TTY drivers.

Terminal Support

The Simplified Chinese Solaris Operating System supports Chinese terminals (EUC-GB). The terminals should have built-in Simplified Chinese fonts and input methods.

Installing a Terminal

If you have not added a terminal to your system before, install a terminal in ASCII mode only.

How to Install a Terminal

You can use the serial ports option from the Admintool menu to configure serial ports for terminals. Serial ports provide the easiest means of installing a terminal.

  1. Become superuser.


    system% su
    
  2. Type admintool.

    The admintool menu appears.


    system# admintool
    
  3. Select the serial ports icon.

  4. Select edit on the serial ports menu.

    The modify service submenu appears.

  5. On the modify service submenu, select enabled, baud rate 9600. Then enter the terminal type.

    The preceding context describes the graphic.

How to Set Up a ttya Port from the Command Line

Use the following procedure is required tto set up a terminal on ttya port from the command line.

  1. Determine the port monitor version number.


    # ttyadm -V
    

    The port monitor version number will display.

  2. Enter the following commands and substitute the port monitor version number for ver.


    # pmadm -r -p zsmon -s ttya
    # sacadm -a -p zsmon -t ttymon -c /usr/lib/saf/ttymon -v ver
    

    For more information, see pmadm(1M) and sacadm(1M) man pages.

  3. Use the pmadm command that matches your terminal type to add a login service.

    For EUC terminals, use the following command.


    # pmadm -a -p zsmon -s ttya -i root -fu -v ver -m "`ttyadm -S y \
      -T terminal_type -d /dev/ttya -l 9600 -m ldterm,ttcompat -s \
      /usr/bin/login`"
    
  4. Turn on the terminal.

    Refer to the documentation that accompanies the terminal.

  5. Log in to the terminal.

  6. Check to see that the installation is correct.


    # setenv LANG locale
    # /bin/stty cs8 -istrip defeucw
    

    Note –

    These values show that the operating system is set to communicate with the terminal in 8-bit no-parity mode. Make sure the terminal is set up in 8-bit no-parity mode. Refer to the terminal's setup manual for the proper way to set terminal options.


How to Verify TTY Set Up

Do the Use the following procedure to verify that your TTY is properly set up .

  1. Type the /bin/stty command with the -a option.


    system% /bin/stty -a
    
  2. If the cs8, -istrip values set in the previous procedure are not listed, use the following command to set them.


    system% /bin/stty cs8 -istrip defeucw
    

This is the last step in setting up a terminal. The default setting of a Simplified Chinese terminal is the completion-code mode. Continue to the next section to install a Packed-code TTY.

Chapter 12 Backward Compatibility

This chapter contains information for making programs backward-compatible with earlier versions of Asian Solaris software. Every utility described is supported. For this version of Solaris, you are encouraged to use the XPG4 internationalization APIs described in International Language Environments Guide.

Simplified Chinese Test Utilities

These utilities test various aspects of the Simplified Chinese (GB-2312-80) national standard character set. They also assume that the character being tested is part of the national standard character set.

The arguments for the functions in these tables must be a character in WC, wchar_t. For more information, see the cctype(3x)man page.

Table 12–1 Simplified Chinese Character Classification Functions

Routine 

Description 

ischanzi

Returns true if it is a Hanzi ideogram in GB-2312-80. 

iscaccent

Returns true if it is an accent notation in GB-2312-80. 

iscphonetic

Returns true if it is a phonetic symbol in GB-2312-80. 

iscpinyin

Returns true if it is a Pinyin symbol in GB-2312-80. 

iscalpha

Returns true if it is a Roman alphabetic in GB-2312-80. 

iscdigit

Returns true if it is a Roman digit in GB-2312-80. 

iscnumber

Returns true if it is a number in GB-2312-80. 

isclower

Returns true if it is a Roman lowercase in GB-2312-80. 

iscupper

Returns true if it is a Roman uppercase in GB-2312-80. 

iscblank

Returns true if it is a white space character from GB-2312-80. 

iscspace

Returns true if it is a space character from GB-2312-80. 

iscgen

Returns true if it is a graphic or general symbol in GB-2312-80. 

iscsci

Returns true if it is a scientific symbol in GB-2312-80. 

iscline

Returns true if it is a ruled line symbol in GB-2312-80. 

iscunit

Returns true if it is a unit character in GB-2312-80. 

iscparen

Returns true if it is a right or left parenthesis in GB-2312-80. 

iscpunct

Returns true if it is a punctuation character in GB-2312-80. 

iscgreek

Returns true if it is a Greek character in GB-2312-80. 

iscrussian

Returns true if it is a Russian character in GB-2312-80. 

iscspecial

Returns true if it is a Greek or Russian character in GB-2312-80. 

ischira

Returns true if it is a Japanese Hiragana character in GB-2312-80. 

isckata

Returns true if it is a Japanese Katakana character in GB-2312-80. 

Two additional routines for Simplified Chinese, iscgb and isceuc, test for characters from the GB-2312-80 character set. The iscgb routine expects a wide character, and isceuc expects a GB-2312-80 character in EUC format. For more information, see the cctype(3x) man page.

Table 12–2 General Simplified Chinese General Character Classification Functions

Routine 

Description 

iscgb

Returns true if it is in GB-2312-80. 

isceuc

Returns true if it is a GB-2312-80 character in EUC format. 

Simplified Chinese Conversion Utilities

This section describes functions for wide character and string input and output, character classification, and conversion functions for the Simplified Chinese character sets. Solaris 2.7 software implements a wide character library for handling Simplified Chinese character codes according to industry standards.

Routines that have Chinese language-specific dependency are in their own language-specific library, which is linked with the corresponding C compiler option. Simplified Chinese Solaris libcle is linked with -lcle

Refer to the appropriate man pages for more information.

Asian Solaris software defines WC as a constant-width, four-byte code. WC uses the ANSI C data type wchar_t, which Solaris software defines in wchar.h as follows:

typedef long wchar_h;

In Solaris software, long is four bytes.

Conversion Utilities

The conversion functions described in this section are available, but you should use iconv() as a standard function.

Simplified Chinese Solaris software provides facilities for various conversions, for example:

Programs using the general multibyte conversion utilities should include the header files widec.h and wctype.h. Simplified Chinese Solaris specific routines (such as iscxxx) are declared in zh/xctype.h.

Programs using general multibyte conversion utilities should include three header files: wctype.h, widec.h, and zh/xctype.h.

The locale/xctype.h file declares the Chinese locale-specific routines, which have names of the form iscxxxx:

As with the classification functions described in the previous section, the use of these functions can be controlled by the setlocale function (described elsewhere in this and other chapters).

Locale-specific conversion routines (such as Chinese cgbtoeuc) are contained in the libcle library:

This library can be linked during compilation using the C compiler option -lcle.

Conversion Within a Code Set

The multibyte conversion functions are similar to the one-byte conversion functions toupper and tolower. These functions convert wide-characters to other wide characters. For more information on conversion routines, see the man pages for wconv(3) and cconv(3).

The following routines are in the regular Chinese C library.

Table 12–3 Simplified Chinese Case Conversion Functions (declared in zh/xctype.h)

Function 

Description 

tocupper

Converts code set1 Roman lowercase to uppercase 

toclower

Converts code set1 Roman uppercase to lowercase 

Conversion Between Simplified Chinese Code Sets

In the Simplified Chinese character sets, the Roman characters and numbers in code set 0 are repeated in code set 1. The following functions test wide characters.

Table 12–4 Simplified Chinese Code Set Conversion Functions

Function 

Description 

atocgb

Converts alphabetic or numeric characters in ASCII (code set0) to the corresponding characters in GB-2312-80 (code set1). 

cgbtoa

Converts alphabetic or numeric characters in GB-2312-80 (code set1) to the corresponding characters in ASCII (code set0). 

For further information on these functions, see the man page for cconv()(3x).

Conversion for Simplified Chinese Character Codes

The following routines do character-based code conversion on the GB-2312-80 character set. They convert characters and strings between EUC format and GB-2312-80 format. To use these routines, the library libcle must be linked using the C compiler option -lcle. For further information, see the cconv(3) man page.

Table 12–5 Simplified Chinese Character-Based Functions

Function 

Description 

cgbtoeuc

Converts a character in GB-2312-80 format (7 bit) to EUC format  

scgbtoeuc

Converts a string in GB-2312-80 format (7 bit) to EUC format  

sncgbtoeuc

Converts part of a string in GB-2312-80 format (7 bit) to EUC format 

euctocgb

Converts a character in EUC format to GB-2312-80 format (7 bit) 

seuctocgb

Converts a string in EUC format in GB-2312-80 format (7 bit) 

sneuctocgb

Converts a part of a string in EUC to GB-2312-80 format (7 bit) 

Binary Compatibility Package (BCP)

Applications compiled under Chinese OpenWindows 2.x or Solaris 1.x or SunOS 4.x systems have different binary formats than the current Chinese Solaris release. Older applications can nevertheless be run under the current Chinese release without being recompiled by using its included binary compatibility package (BCP).


Note –

SUNWowbcp must be included in your system configuration in order for you to run the following commands. See your system administrator for installation.


Running Earlier Binary Code

The following BCP command runs the compiled binary code of earlier SunOS4.x, Solaris 1.x, or Chinese OpenWindows 2.x applications without recompilation, However, OpenWindows V2 Chinese applications will display no input server status region. As shown in the following examples, the command calls the application by its old name (old_application_name) and sets the basic locale, input language, and display language using the older version's specific locale name (old-locale):


system% old_application_name -lc_basiclocale 
old-locale -lc_inputlang old-locale 
\ -lc_displaylang old-locale

The following example shows the command for running the compiled binary code of an earlier version of the textedit application in the current Simplified Chinese Solaris environment:


system% textedit -lc_displaylang chinese -lc_basiclocale chinese \
    -lc_inputlang chinese

Due to incompatibilities between Simplified Chinese Solaris 2.x and 1.x applications, you cannot cut and paste Chinese characters between them.