Lotus Multi-Byte Character Set

From HandWiki
Short description: Character encoding system

The Lotus Multi-Byte Character Set (LMBCS) is a proprietary multi-byte character encoding originally conceived in 1988 at Lotus Development Corporation with input from Bob Balaban and others.[1] Created around the same time and addressing some of the same problems, LMBCS could be viewed as parallel development and possible alternative to Unicode.[1] For maximum compatibility, later issues of LMBCS incorporate UTF-16 as a subset.[2][3]

Commercially, LMBCS was first introduced as the default character set of Lotus 1-2-3 Release 3 for DOS in March 1989[1][4] and Lotus 1-2-3/G Release 1 for OS/2[1] in 1990 replacing the 8-bit Lotus International Character Set (LICS) and ASCII used in earlier DOS-only versions of Lotus 1-2-3 and Symphony.[5] LMBCS is also used in IBM/Lotus SmartSuite, Notes and Domino,[1] as well as in a number of third-party products.

LMBCS encodes the characters required for languages using the Latin,[6] Arabic, Hebrew, Greek and Cyrillic[6] scripts, the Thai, Chinese, Japanese[6] and Korean writing systems, and technical symbols.

Template:Anchor (or Anchors): too many anchors, maximum is tenEncodings

Technically, LMBCS is a lead-byte encoding where code point 00hex as well as code points 20hex (32) to 7Fhex (127) are identical to ASCII[1] (as well as to LICS).[5]

Code point 00hex is always treated as NUL character to ensure maximum code compatibility with existing software libraries dealing with null-terminated strings[1] in many programming languages such as C.[lower-alpha 1] This applies even to the UTF-16be codes, where code words with the form xx00hex are mapped to private-use codes with the form F6xxhex during encoding in order to avoid the use of NUL bytes,[7] and to escaped control characters, where 20hex is added to the C0 (but not C1) control characters following the 0Fhex lead byte.[7]

Code points 01hex to 1Fhex, which serve as control codes in ASCII, are used as lead bytes to switch the definition of code points above 7Fhex between several code groups (similar to code pages) and at the same time determine either a single- or multi-byte nature for the corresponding code group.[1]

For example, code group 1 (with group byte 01hex)[1] is almost identical to the SBCS code page 850, whereas code group 16 (with group byte 10hex)[1] is similar to the Japanese MBCS code page 932. Multi-byte characters can thus occupy two or three bytes.[7][6]

In canonical LMBCS, each character starts with its group byte.[1] To reduce the length, in optimized or compressed LMBCS a default code group or optimization group code can be defined on a per application or process basis (ideally chosen according to the highest likelihood of occurrence)[1] and must be communicated to the interpreting code in some way (f.e. by specifying the corresponding "LMBCS-n" name).[8] Thereby, the group byte can be omitted for these characters.[1] Lotus 1-2-3 retrieves the optimization group code from the file header of the corresponding source file,[7] whereas for Lotus Notes the optimization group code is fixed to be always 01hex.[2][7]

Default Group Bytes Description
N/A 00hex 1[7] NUL
LMBCS-1 01hex 2[7] Code page 850 (DOS Latin-1)[2][7]
LMBCS-2 02hex 2[7] Code page 851 (DOS Greek)[2][7]
LMBCS-3 03hex 2[7] Code page 1255 (Windows Hebrew)[2][7]
LMBCS-4 04hex 2[7] Code page 1256 (Windows Arabic)[2][7]
LMBCS-5 05hex 2[7] Code page 1251 (Windows Cyrillic)[2][7]
LMBCS-6 06hex 2[7] Code page 852 (DOS Latin-2)[2][7]
N/A 07hex 1[7] BEL[2]
LMBCS-8 08hex 2[7] Code page 1254 (Windows Turkish)[2][9][7]
N/A 09hex 1[7] TAB[2][9][7]
N/A 0Ahex 1[7] LF[2][9][7]
LMBCS-11 0Bhex 2[7] Code page 874 (Thai)[9][7]
(LMBCS-12) 0Chex 2[7] Reserved[2]
N/A 0Dhex 1[7] CR[2][9][7]
(LMBCS-14) 0Ehex 2[7] Reserved[2]
(LMBCS-15) 0Fhex 2[7] Remapped C0/C1 control codes[7]
LMBCS-16 10hex 3[7] Code page 932/[2]943[7] (Japanese / Shift-JIS)[2][9]
LMBCS-17 11hex 3[7] Code page 949/[2]1261[7] (Korean)[2][9]
LMBCS-18 12hex 3[7] Code page 950[2][7] (Traditional Chinese / Taiwan / Big5)[2][9]
LMBCS-19 13hex 3[7] Code page 936/[2]1386[7] (Simplified Chinese)[2][9]
(LMBCS-20) 14hex 3[7] UTF-16 (Unicode)[2][3][7]
N/A 15hex 3 Reserved[2]
N/A 16hex 3 Reserved[2]
N/A 17hex 3 Reserved[2]
N/A 18hex 3 Reserved[2]
N/A 19hex 1[7] Lotus 1-2-3 system range[9][7]
N/A 1Ahex 3 Reserved[2]
N/A 1Bhex 3 Reserved[2]
N/A 1Chex 3 Reserved[2]
N/A 1Dhex 3 Reserved[2]
N/A 1Ehex 3 Reserved[2]
N/A 1Fhex 3 Reserved[2]

Character set

Without prefix byte the code points 32 (20hex) to 127 (7Fhex) are interpreted as follows (corresponding to LMBCS codes 32 to 127):

Single byte codes (ASCII/ISO-646-US[10])
0 1 2 3 4 5 6 7 8 9 A B C D E F
 SP  ! " # $ % & ' ( ) * + , - . /
0 1 2 3 4 5 6 7 8 9 : ; < = > ?
@ A B C D E F G H I J K L M N O
P Q R S T U V W X Y Z [ \ ] ^
` a b c d e f g h i j k l m n o
p q r s t u v w x y z { | } ~ DEL/⌂

Group 1

LMBCS group 1 code points 128 (80hex) to 255 (FFhex) are identical to the corresponding code points in code page 850 (DOS Latin-1), whereas code points 1 (01hex) to 127 (7Fhex) are defined according to the following exception list (corresponding to LMBCS codes 256 to 383):

LMBCS Group 1, lower half[11][10]
0 1 2 3 4 5 6 7 8 9 A B C D E F
NUL
§
¨ ~ ˚ ^ ` ´ ' -[lower-alpha 2] [lower-alpha 3] [lower-alpha 3]
¨[lower-alpha 4] ~[lower-alpha 4] ˚[lower-alpha 4] ^[lower-alpha 4] `[lower-alpha 4] ´[lower-alpha 4] nbsp[lower-alpha 3] [lower-alpha 3]
Œ œ Ÿ ˙[lower-alpha 3] ˚[lower-alpha 3][lower-alpha 4] [lower-alpha 3] [lower-alpha 3] [lower-alpha 3] [lower-alpha 3] [lower-alpha 3]
ij IJ ʼn ŀ Ŀ ¯[lower-alpha 3] ˘[lower-alpha 3] ˝[lower-alpha 3] ˛[lower-alpha 3] ˇ[lower-alpha 3] ~[lower-alpha 3][lower-alpha 4] ^[lower-alpha 3][lower-alpha 4]
Ħ[lower-alpha 3] ħ[lower-alpha 3] Ŧ[lower-alpha 3] ŧ[lower-alpha 3] Ŋ[lower-alpha 3] ŋ[lower-alpha 3] ĸ[lower-alpha 3] Kr[lower-alpha 5]
  U+Mapped to a Unicode private use character

Group 2

LMBCS group 2 code points 128 (80hex) to 255 (FFhex) are identical to the corresponding code points in code page 851 (DOS Greek), whereas code points 1 (01hex) to 127 (7Fhex) are defined according to the following exception list:[lower-alpha 6]

LMBCS Group 2, lower half[11]
0 1 2 3 4 5 6 7 8 9 A B C D E F
NUL ͺ ΅ Ϊ Ϋ ΄ ʼ ʽ
φ
  Mapped to a Unicode private use character

Group 6

LMBCS group 6 code points 128 (80hex) to 255 (FFhex) are identical to the corresponding code points in code page 852 (DOS Latin-2), whereas code points 1 (01hex) to 127 (7Fhex) are defined according to the following exception list:[lower-alpha 6]

LMBCS Group 6, lower half[11]
0 1 2 3 4 5 6 7 8 9 A B C D E F
NUL ā Ĉ ĉ Ċ ċ Ē ē Ė ė Ĝ ĝ Ġ ġ Ģ ģ
Ĥ ĥ Ĩ ĩ Ī ī Į į Ĵ ĵ Ķ ķ Ļ ļ Ņ ņ
Ō ō Ŗ ŗ Ŝ ŝ Ũ ũ Ū ū Ŭ ŭ Ų ų Ā

See also

Notes

  1. Lotus 1-2-3 Release 3.0 for DOS and newer versions are written in C.
  2. ‐ (U+2010), ‑ (U+2011), ‒ (U+2012), – (U+2013)
  3. 3.00 3.01 3.02 3.03 3.04 3.05 3.06 3.07 3.08 3.09 3.10 3.11 3.12 3.13 3.14 3.15 3.16 3.17 3.18 3.19 3.20 3.21 3.22 3.23 3.24 According to the documentation this code point is not supported by Lotus 1-2-3 Release 3.1+ for DOS and OS/2 and earlier.
  4. 4.0 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 For compatibility with Lotus 1-2-3 Release 5.0.
  5. Unicode does not define a glyph for the crown currency symbol (Krone aka "Kr"), therefore this points to F8FBhex in the Unicode Private Use Area (PUA).
  6. 6.0 6.1 According to the documentation code points 1 to 127 in this group are not supported by Lotus 1-2-3 Release 3.1+ for DOS and OS/2 and earlier. These versions only supported LMBCS code points 0 to 511, covering group 0 and 1 only.

References

  1. 1.00 1.01 1.02 1.03 1.04 1.05 1.06 1.07 1.08 1.09 1.10 1.11 1.12 "Multi-Language Character Sets – What They Are, How To Use Them". Looseleaf Software, Inc.. 2001. http://www.bobzblog.com/tuxedoguy.nsf/dx/multilanguage.pdf/$file/multilanguage.pdf. 
  2. 2.00 2.01 2.02 2.03 2.04 2.05 2.06 2.07 2.08 2.09 2.10 2.11 2.12 2.13 2.14 2.15 2.16 2.17 2.18 2.19 2.20 2.21 2.22 2.23 2.24 2.25 2.26 2.27 2.28 2.29 2.30 2.31 2.32 2.33 "Appendix A. Encoding Schemes". IBM Character Data Representation Architecture. IBM (CDRA). Lotus Multi-byte Character Set (LMBCS). https://www-01.ibm.com/software/globalization/cdra/appendix_a.html#Lotus%20Multi-byte%20Character%20Set%20(LMBCS). "For optimization purposes, the group byte is omitted in Notes for single-byte values between X'20' and X'FF'. For example, LMBCS is always optimized to group 0x01, which means that any character where the first byte is greater than 0x1F, has an implicit group byte of 0x01." 
  3. 3.0 3.1 "Re: MS Excel, Lotus 123 & Unicode". 2000-06-02. http://unicode.org/mail-arch/unicode-ml/Archives-Old/UML022/1278.html. 
  4. "Kapitel 4. Kompatibilität mit anderen 1-2-3 Versionen – Zeichensätze" (in German). Lotus 1-2-3 Version 3.1 Upgrader's Handbuch (1 ed.). Cambridge, MA, USA: Lotus Development Corporation. 1989. pp. 4-10–4-11. 302173. 
  5. 5.0 5.1 (in German) Das große Buch zu Lotus 1-2-3 für DOS (1 ed.). Data Becker. 1992. pp. 131–132, 357-358. ISBN 3-89011-375-3. 
  6. 6.0 6.1 6.2 6.3 Lotus – Inside Notes – The Architecture of Notes and the Domino Server. Lotus Development Corporation. 2000. http://www-12.lotus.com/ldd/doc/uafiles.nsf/70817c90542892178525695b0051105c/2e559b131d346a028525697c00652c2b/$FILE/InsideNotes.pdf. Retrieved 2016-12-12. "[…] Notes uses a single character set, the Lotus Multibyte Character Set (LMBCS), to encode all text data used internally by its programs. Whenever Notes first inputs text encoded in a character set other than LMBCS, it translates the text into a LMBCS string, and whenever it must output text in a character set other than LMBCS, it translates the internal LMBCS string into the appropriate character set. Because all text is internally formatted by LMBCS, all text-processing operations […] are done in only one way. LMBCS uses up to three bytes in memory to represent a single text character […]" 
  7. 7.00 7.01 7.02 7.03 7.04 7.05 7.06 7.07 7.08 7.09 7.10 7.11 7.12 7.13 7.14 7.15 7.16 7.17 7.18 7.19 7.20 7.21 7.22 7.23 7.24 7.25 7.26 7.27 7.28 7.29 7.30 7.31 7.32 7.33 7.34 7.35 7.36 7.37 7.38 7.39 7.40 7.41 7.42 7.43 7.44 "ucnv_lmb.c". International Components for Unicode. International Business Machines (IBM). 2016. https://opensource.apple.com/source/ICU/ICU-59180.0.1/icuSources/common/ucnv_lmb.cpp.auto.html. 
  8. "Re: converter types". International Components for Unicode (ICU). 2001-11-03. https://sourceforge.net/p/icu/mailman/message/7389276/. 
  9. 9.0 9.1 9.2 9.3 9.4 9.5 9.6 9.7 9.8 9.9 "LMBCS" (in Japanese). 2009-02-03. http://hnagasim.blog8.fc2.com/blog-entry-81.html. [1]
  10. 10.0 10.1 "Anhang 2. Der Lotus Multibyte Zeichensatz (LMBCS)" (in German). Lotus 1-2-3 Version 3.1 Referenzhandbuch (1 ed.). Cambridge, MA, USA: Lotus Development Corporation. 1989. pp. A2-1 – A2-13. 302168. 
  11. 11.0 11.1 11.2 "lmb-excp.ucm". 2000-02-10. https://github.com/unicode-org/icu/blob/master/icu4c/source/data/mappings/lmb-excp.ucm. 

Further reading

External links