diff options
author | Kenichi Handa <handa@m17n.org> | 2000-12-14 01:27:43 +0000 |
---|---|---|
committer | Kenichi Handa <handa@m17n.org> | 2000-12-14 01:27:43 +0000 |
commit | 764ca8dad891809af141ca2a6d7e19a3e89955ee (patch) | |
tree | 12831146d56d7b046fd4660e80716c89d77862fc /src/coding.c | |
parent | 1da1bb05a859d33100b018259458ae5436767c17 (diff) | |
download | emacs-764ca8dad891809af141ca2a6d7e19a3e89955ee.tar.gz emacs-764ca8dad891809af141ca2a6d7e19a3e89955ee.tar.bz2 emacs-764ca8dad891809af141ca2a6d7e19a3e89955ee.zip |
(decode_coding_string): Set coding->src_multibyte and
coding->dst_multibyte before calling detect_coding and detect_eol.
Update them after some coding system is detected.
Diffstat (limited to 'src/coding.c')
-rw-r--r-- | src/coding.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/coding.c b/src/coding.c index 44647abaf13..6343187fb06 100644 --- a/src/coding.c +++ b/src/coding.c @@ -5328,6 +5328,8 @@ decode_coding_string (str, coding, nocopy) to_byte = STRING_BYTES (XSTRING (str)); saved_coding_symbol = Qnil; + coding->src_multibyte = STRING_MULTIBYTE (str); + coding->dst_multibyte = 1; if (CODING_REQUIRE_DETECTION (coding)) { /* See the comments in code_convert_region. */ @@ -5350,9 +5352,10 @@ decode_coding_string (str, coding, nocopy) } } - coding->src_multibyte = 0; - coding->dst_multibyte = (coding->type != coding_type_no_conversion - && coding->type != coding_type_raw_text); + if (coding->type == coding_type_no_conversion + || coding->type == coding_type_raw_text) + coding->dst_multibyte = 0; + require_decoding = CODING_REQUIRE_DECODING (coding); if (STRING_MULTIBYTE (str)) @@ -5361,6 +5364,7 @@ decode_coding_string (str, coding, nocopy) str = Fstring_as_unibyte (str); to_byte = STRING_BYTES (XSTRING (str)); nocopy = 1; + coding->src_multibyte = 0; } /* Try to skip the heading and tailing ASCIIs. */ |