aboutsummaryrefslogtreecommitdiffstats
path: root/src/coding.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/coding.c')
-rw-r--r--src/coding.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/coding.c b/src/coding.c
index da625403441..901f806e44b 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -7437,10 +7437,23 @@ decode_coding (struct coding_system *coding)
7437 7437
7438 while (nbytes-- > 0) 7438 while (nbytes-- > 0)
7439 { 7439 {
7440 int c = *src++; 7440 int c;
7441 7441
7442 if (c & 0x80) 7442 /* Copy raw bytes in their 2-byte forms from multibyte
7443 c = BYTE8_TO_CHAR (c); 7443 text as single characters. */
7444 if (coding->src_multibyte
7445 && CHAR_BYTE8_HEAD_P (*src) && nbytes > 0)
7446 {
7447 c = STRING_CHAR_ADVANCE (src);
7448 nbytes--;
7449 }
7450 else
7451 {
7452 c = *src++;
7453
7454 if (c & 0x80)
7455 c = BYTE8_TO_CHAR (c);
7456 }
7444 coding->charbuf[coding->charbuf_used++] = c; 7457 coding->charbuf[coding->charbuf_used++] = c;
7445 } 7458 }
7446 produce_chars (coding, Qnil, 1); 7459 produce_chars (coding, Qnil, 1);