comparison src/coding.c @ 31455:0b33b8c5d16e

(encode_coding_sjis_big5): Use translation table for encoding, not decoding. Check for the charset katakana-jisx0201, not latin-jisx0201. (ONE_MORE_CHAR): Call translate_char with CHARSET arg -1.
author Kenichi Handa <handa@m17n.org>
date Thu, 07 Sep 2000 12:04:09 +0000
parents 097593e77185
children b1c66af9aba5
comparison
equal deleted inserted replaced
31454:4dd84bbe2c6c 31455:0b33b8c5d16e
233 || UNIBYTE_STR_AS_MULTIBYTE_P (src, len, bytes)) \ 233 || UNIBYTE_STR_AS_MULTIBYTE_P (src, len, bytes)) \
234 c = STRING_CHAR_AND_LENGTH (src, len, bytes); \ 234 c = STRING_CHAR_AND_LENGTH (src, len, bytes); \
235 else \ 235 else \
236 c = *src, bytes = 1; \ 236 c = *src, bytes = 1; \
237 if (!NILP (translation_table)) \ 237 if (!NILP (translation_table)) \
238 c = translate_char (translation_table, c, 0, 0, 0); \ 238 c = translate_char (translation_table, c, -1, 0, 0); \
239 src += bytes; \ 239 src += bytes; \
240 } while (0) 240 } while (0)
241 241
242 242
243 /* Produce a multibyte form of characater C to `dst'. Jump to 243 /* Produce a multibyte form of characater C to `dst'. Jump to
2547 2547
2548 if (NILP (Venable_character_translation)) 2548 if (NILP (Venable_character_translation))
2549 translation_table = Qnil; 2549 translation_table = Qnil;
2550 else 2550 else
2551 { 2551 {
2552 translation_table = coding->translation_table_for_decode; 2552 translation_table = coding->translation_table_for_encode;
2553 if (NILP (translation_table)) 2553 if (NILP (translation_table))
2554 translation_table = Vstandard_translation_table_for_decode; 2554 translation_table = Vstandard_translation_table_for_encode;
2555 } 2555 }
2556 2556
2557 while (1) 2557 while (1)
2558 { 2558 {
2559 int c, charset, c1, c2; 2559 int c, charset, c1, c2;
2594 || charset == charset_jisx0208_1978) 2594 || charset == charset_jisx0208_1978)
2595 { 2595 {
2596 ENCODE_SJIS (c1, c2, c1, c2); 2596 ENCODE_SJIS (c1, c2, c1, c2);
2597 EMIT_TWO_BYTES (c1, c2); 2597 EMIT_TWO_BYTES (c1, c2);
2598 } 2598 }
2599 else if (charset == charset_latin_jisx0201) 2599 else if (charset == charset_katakana_jisx0201)
2600 EMIT_ONE_BYTE (c1); 2600 EMIT_ONE_BYTE (c1 | 0x80);
2601 else 2601 else
2602 /* There's no way other than producing the internal 2602 /* There's no way other than producing the internal
2603 codes as is. */ 2603 codes as is. */
2604 EMIT_BYTES (src_base, src); 2604 EMIT_BYTES (src_base, src);
2605 } 2605 }