Mercurial > emacs
comparison src/ccl.c @ 29170:401490c30961
(ccl_driver) <CCL_ReadMultibyteChar2>
<CCL_WriteMultibyteChar2>: Handle charsets eight-bit-control and
eight-bit-graphic correctly.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Thu, 25 May 2000 01:30:37 +0000 |
parents | 8dfd5b675823 |
children | e0ca767b77f1 |
comparison
equal
deleted
inserted
replaced
29169:23b00eb0af27 | 29170:401490c30961 |
---|---|
1189 reg[RRR] = *src++; | 1189 reg[RRR] = *src++; |
1190 i = (*src++ & 0x7F); | 1190 i = (*src++ & 0x7F); |
1191 reg[rrr] = ((i << 7) | (*src & 0x7F)); | 1191 reg[rrr] = ((i << 7) | (*src & 0x7F)); |
1192 src++; | 1192 src++; |
1193 } | 1193 } |
1194 else if (i == LEADING_CODE_8_BIT_CONTROL) | |
1195 { | |
1196 if ((src + 1) >= src_end) | |
1197 goto ccl_read_multibyte_character_suspend; | |
1198 reg[RRR] = CHARSET_8_BIT_CONTROL; | |
1199 reg[rrr] = (*src++ - 0x20); | |
1200 } | |
1201 else if (i >= 0xA0) | |
1202 { | |
1203 reg[RRR] = CHARSET_8_BIT_GRAPHIC; | |
1204 reg[rrr] = i; | |
1205 } | |
1194 else | 1206 else |
1195 { | 1207 { |
1196 /* INVALID CODE. Return a single byte character. */ | 1208 /* INVALID CODE. Return a single byte character. */ |
1197 reg[RRR] = CHARSET_ASCII; | 1209 reg[RRR] = CHARSET_ASCII; |
1198 reg[rrr] = i; | 1210 reg[rrr] = i; |
1213 | 1225 |
1214 break; | 1226 break; |
1215 | 1227 |
1216 case CCL_WriteMultibyteChar2: | 1228 case CCL_WriteMultibyteChar2: |
1217 i = reg[RRR]; /* charset */ | 1229 i = reg[RRR]; /* charset */ |
1218 if (i == CHARSET_ASCII) | 1230 if (i == CHARSET_ASCII |
1231 || i == CHARSET_8_BIT_CONTROL | |
1232 || i == CHARSET_8_BIT_GRAPHIC) | |
1219 i = reg[rrr] & 0xFF; | 1233 i = reg[rrr] & 0xFF; |
1220 else if (CHARSET_DIMENSION (i) == 1) | 1234 else if (CHARSET_DIMENSION (i) == 1) |
1221 i = ((i - 0x70) << 7) | (reg[rrr] & 0x7F); | 1235 i = ((i - 0x70) << 7) | (reg[rrr] & 0x7F); |
1222 else if (i < MIN_CHARSET_PRIVATE_DIMENSION2) | 1236 else if (i < MIN_CHARSET_PRIVATE_DIMENSION2) |
1223 i = ((i - 0x8F) << 14) | reg[rrr]; | 1237 i = ((i - 0x8F) << 14) | reg[rrr]; |