aboutsummaryrefslogtreecommitdiffstats
path: root/src/coding.c
diff options
context:
space:
mode:
authorKenichi Handa <[email protected]>2000-10-13 08:21:20 +0000
committerKenichi Handa <[email protected]>2000-10-13 08:21:20 +0000
commite2c06b17a94a7b06cd27b643f8d5118243f06969 (patch)
tree8f6880ec4a8bb4812b4e38e5d25b864a40c77db5 /src/coding.c
parente4a3f4e178ff322ec2ece71360b7c9c0fbf06fdd (diff)
(decode_coding_string): Set coding->src_multibyte and
coding->dst_multibyte before using CODING_REQUIRE_DECODING. (encode_coding_string): Set coding->src_multibyte and coding->dst_multibyte before using CODING_REQUIRE_ENCODING.
Diffstat (limited to 'src/coding.c')
-rw-r--r--src/coding.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/coding.c b/src/coding.c
index 6d2e6d9c45..282f8e21e8 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -5275,6 +5275,9 @@ 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);
require_decoding = CODING_REQUIRE_DECODING (coding);
if (STRING_MULTIBYTE (str))
@@ -5284,9 +5287,6 @@ decode_coding_string (str, coding, nocopy)
to_byte = STRING_BYTES (XSTRING (str));
nocopy = 1;
}
- coding->src_multibyte = 0;
- coding->dst_multibyte = (coding->type != coding_type_no_conversion
- && coding->type != coding_type_raw_text);
/* Try to skip the heading and tailing ASCIIs. */
if (require_decoding && coding->type != coding_type_ccl)
@@ -5420,6 +5420,11 @@ encode_coding_string (str, coding, nocopy)
to_byte = STRING_BYTES (XSTRING (str));
saved_coding_symbol = Qnil;
+
+ /* Encoding routines determine the multibyteness of the source text
+ by coding->src_multibyte. */
+ coding->src_multibyte = STRING_MULTIBYTE (str);
+ coding->dst_multibyte = 0;
if (! CODING_REQUIRE_ENCODING (coding))
{
coding->consumed = STRING_BYTES (XSTRING (str));
@@ -5434,11 +5439,6 @@ encode_coding_string (str, coding, nocopy)
return (nocopy ? str : Fcopy_sequence (str));
}
- /* Encoding routines determine the multibyteness of the source text
- by coding->src_multibyte. */
- coding->src_multibyte = STRING_MULTIBYTE (str);
- coding->dst_multibyte = 0;
-
if (coding->composing != COMPOSITION_DISABLED)
coding_save_composition (coding, from, to, str);