Lines Matching full:lmbcs
21 * Add comments to document LMBCS format and implementation
47 LMBCS
51 LMBCS was invented in the late 1980's and is primarily used in Lotus Notes
56 LMBCS to and from Unicode.
58 Since the LMBCS character set is only sparsely documented in existing
60 file to serve as a guide to understanding LMBCS.
62 LMBCS was originally designed with these four sometimes-competing design goals:
71 All of the national character sets LMBCS was trying to encode are 'ANSI'
76 bytes from 0x20-0x7F are represented by the same single-byte values in LMBCS.
78 The general LMBCS code unit is from 1-3 bytes. We can describe the 3 bytes as
84 data bytes. The maximum size of a LMBCS chjaracter is 3 bytes:
95 Since LMBCS is always dealing in byte units. we create a local type here for
96 dealing with these units of LMBCS code units:
102 Most of the values less than 0x20 are reserved in LMBCS to announce
122 So, the beginning of understanding LMBCS is that IF the first byte of a LMBCS
136 However, to fully understand LMBCS, you must also understand a series of
145 character set. So, for example, the LMBCS sequence x10 x10 xAE is the
165 that must be moved to different values because LMBCS reserves those
172 useful doctrine that any byte less than 0x20 in a LMBCS char must be
179 LMBCS, was to use up the spaces of the form
193 represented in LMBCS: */
199 LMBCS from encoding any Unicode values of the form U+F6xx, but that's OK:
204 a LMBCS char that holds a literal Unicode value */
208 To squish the LMBCS representations down even further, and to make
210 from a LMBCS character. This is decided on a process-by-process basis. The
219 optimization group as part of the name of the converter (LMBCS-1, LMBCS-2,
220 etc.). Using plain 'LMBCS' as the name of the converter will give you
221 LMBCS-1.
227 Because of the extensive use of other character sets, the LMBCS converter
235 #define ULMBCS_GRP_LAST 0x13 /* last LMBCS group that has a converter */
265 LMBCS to Unicode.
268 However, to translate Unicode to LMBCS, we need some more support.
271 code point back into LMBCS. The first thing we do is look up into a table
276 SBCS, the table will place it in the SBCS sets, to make the LMBCS code point
281 LMBCS sbcs native encoding
284 LMBCS mbcs native encoding
468 LMBCS groups. We use this table, and the associated code, to
472 This table maps locale ID's to LMBCS opt groups.
568 vtable. There is also room in there for converter-specific data. LMBCS
580 uint8_t OptGroup; /* default Opt. grp. for this LMBCS session */
607 "LMBCS-" #n,\
689 UConverterDataLMBCS lmbcs;
711 uprv_memcpy(&newLMBCS->lmbcs, extraInfo, sizeof(UConverterDataLMBCS));
720 newLMBCS->cnv.extraInfo = &newLMBCS->lmbcs;
730 * which means that LMBCS can convert all Unicode code points after all.
738 Unicode to LMBCS, and we suspect that a Unicode character will fit into
817 know we are writing LMBCS using the Unicode group
822 /* encode into LMBCS Unicode range */
843 /* The main Unicode to LMBCS conversion function */
850 ulmbcs_byte_t LMBCS[ULMBCS_CHARSIZE_MAX];
857 /* Basic strategy: attempt to fill in local LMBCS 1-char buffer.(LMBCS)
895 pLMBCS = LMBCS;
926 bytes_written = (int32_t)(pLMBCS - LMBCS);
941 bytes_written = (int32_t)(pLMBCS - LMBCS);
1040 bytes_written = (int32_t)(pLMBCS - LMBCS);
1047 pLMBCS = LMBCS;
1077 /* Now, the Unicode from LMBCS section */
1080 /* A function to call when we are looking at the Unicode group byte in LMBCS */
1082 GetUniFromLMBCSUni(char const ** ppLMBCSin) /* Called with LMBCS-style Unicode byte stream */
1084 uint8_t HighCh = *(*ppLMBCSin)++; /* Big-endian Unicode in LMBCS compatibility group*/
1109 /* Return the Unicode representation for the current LMBCS character */
1129 * 1. 'CurByte' points at the first byte of a LMBCS character
1133 * 1. set '*source' to point at the beginning of next char (nop if LMBCS char is only 1 byte)
1181 /* check for LMBCS doubled-group-byte case */
1250 /* The exported function that converts lmbcs to one or more
1257 char LMBCS [ULMBCS_CHARSIZE_MAX];
1275 size_t size_new_maybe_1 = sizeof(LMBCS) - size_old;
1280 uprv_memcpy(LMBCS, args->converter->toUBytes, size_old);
1281 uprv_memcpy(LMBCS + size_old, args->source, size_new);
1283 args->source = errSource = LMBCS;
1284 args->sourceLimit = LMBCS+size_old+size_new;
1287 args->source = saveSource + ((args->source - LMBCS) - size_old);
1294 uprv_memcpy(args->converter->toUBytes, LMBCS, savebytes);