Mercurial > emacs
changeset 89933:48af0ea7d387
(setup_coding_system): Set coding->common_flags
correctly for raw-text.
(consume_chars): On encoding unibyte text by raw-text, don't check
multibyte form.
(encode_coding): On encoding by raw-text, never use translation
tables.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Wed, 28 Apr 2004 12:52:51 +0000 |
parents | 67cdf4445614 |
children | 5ddb430894bf |
files | src/coding.c |
diffstat | 1 files changed, 14 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/coding.c Wed Apr 28 12:50:36 2004 +0000 +++ b/src/coding.c Wed Apr 28 12:52:51 2004 +0000 @@ -5093,6 +5093,13 @@ coding->detector = NULL; coding->decoder = decode_coding_raw_text; coding->encoder = encode_coding_raw_text; + if (! EQ (eol_type, Qunix)) + { + coding->common_flags |= CODING_REQUIRE_DECODING_MASK; + if (! VECTORP (eol_type)) + coding->common_flags |= CODING_REQUIRE_ENCODING_MASK; + } + } return; @@ -6381,7 +6388,9 @@ { EMACS_INT bytes; - if ((bytes = MULTIBYTE_LENGTH (src, src_end)) > 0) + if (coding->encoder == encode_coding_raw_text) + c = *src++, pos++; + else if ((bytes = MULTIBYTE_LENGTH (src, src_end)) > 0) c = STRING_CHAR_ADVANCE (src), pos += bytes; else c = BYTE8_TO_CHAR (*src), src++, pos++; @@ -6466,7 +6475,10 @@ int max_lookup; attrs = CODING_ID_ATTRS (coding->id); - translation_table = get_translation_table (attrs, 1, &max_lookup); + if (coding->encoder == encode_coding_raw_text) + translation_table = Qnil, max_lookup = 0; + else + translation_table = get_translation_table (attrs, 1, &max_lookup); if (BUFFERP (coding->dst_object)) {