The Multibyte English (MBE) locale contains four encodings of English characters:
- ASCII (7-bit, 1 byte)
- Japanese Extended UNIX® Code (EUC) full size ASCII characters (2 bytes)
- Japanese shift-JIS (SJIS) full size ASCII characters (2 bytes)
- Private MBE encoding (3-4 bytes)
The ASCII characters are displayed in the MBE locale in the Lucida font type. The other three encodings are all displayed using the same
double wide font.
The Japanese EUC encoding is provided for partial compatability with
XView applications because the XView toolkit has dependencies on EUC
encoded characters and will not display the SJIS or private MBE encodings.
The SJIS encoding is provided for Java applications which must use an
encoding that is supported within the Java environment. The default MBE encoding is dependent
upon the MBE locale. For en_FW.MBE locale, the default MBE
encoding is the private MBE encoding. For en_FW.PCK locale,
the default MBE encoding is the SJIS encoding. The Japanese EUC
is only used in XView message catalogs but can be selected with the
-e option of the conversion utilities.
NOTE: The private MBE encoding is more complex than either the Japanese EUC
encoding or the SJIS encoding and should be used for internationalization testing whenever possible.
To quickly reveal internationalization bugs, MBE does not sort the code values by ASCII encoding. Some code values are unusual. The
table below shows the code values for the MBE space, A, B, and C characters.
NOTE: The multibyte space in MBE contains the ASCII space character as one of its
bytes.
| Character | First | Second | Third | Fourth |
MBE Space | 0x83 | 0x40(@) | 0x20(sp) |
MBE A | 0x84 | 0x60(`) | 0x41(A) | 0x41(A) |
MBE B | 0x84 | 0x61(a) | 0x42(B) | 0x42(B) |
MBE C | 0x84 | 0x62(b) | 0x43(C) | 0x43(C) |
For all of the code values in MBE, see Section A.2, MBE Characters.
Multibyte English (MBE) locale provides utilities and functions to convert codes from ASCII to MBE and from MBE to ASCII.
Utilities
If you are testing your editor application in MBE, you must input text in MBE to check that the application loads the text correctly. To
generate a text file in MBE, you can use the entombe(1) program to convert
text from ASCII to MBE.
system% entombe abc.txt> mbe.txt
Load the mbe.txt file into the editor and verify that the contents are displayed correctly.
You can also verify that the mbe.txt file was saved correctly by saving it and then using the mbetoen(1) program to convert codes from MBE to ASCII.
system% mbetoen mbe.txt> abc2.txt
You can compare the abc2.txt file with the original abc.txt file.
Functions
You can create your own converter by using the entombe(3x)
and mbetoen(3x)
functions.
#include <mbe.h>
int entombe (char * str , const int c , int mbe );
int mbetoen (int * c , const char * str , int mbe );
The binary must be statically linked with the /usr/lib/libmbe.a
libary. For example:
system% cc -o test test.c -lmbe