aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa2003-05-28 23:27:28 +0000
committerKenichi Handa2003-05-28 23:27:28 +0000
commit103e0180b37bc7df82a0c31be14c50f6758d1bf7 (patch)
tree88c79b0e0c0fcd0fc0072d7b02c6ac2828629e26 /src
parent75a756f1471f181a1226f05eeea50a206eae5a70 (diff)
downloademacs-103e0180b37bc7df82a0c31be14c50f6758d1bf7.tar.gz
emacs-103e0180b37bc7df82a0c31be14c50f6758d1bf7.zip
*** empty log message ***
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog23
-rw-r--r--src/coding.c72
2 files changed, 95 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index a231582d67e..b2e91effc1e 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,26 @@
12003-05-29 Kenichi Handa <handa@m17n.org>
2
3 * coding.c (decode_coding_iso2022): Pay attention to the byte
4 sequence of CTEXT extended segment, and retain those bytes as is.
5
62003-05-28 Kenichi Handa <handa@m17n.org>
7
8 * coding.c (ENCODE_UNSAFE_CHARACTER): Adjusted for the name change
9 of CODING_REPLACEMENT_CHARACTER.
10 (decode_coding_iso2022): If CODING_FLAG_ISO_SAFE, set
11 CODING_MODE_INHIBIT_UNENCODABLE_CHAR flag in coding->mode, and
12 check this flag on encoding.
13 (encode_coding_sjis_big5): Check
14 CODING_MODE_INHIBIT_UNENCODABLE_CHAR flag of coding->mode.
15 (Fset_terminal_coding_system_internal): Set
16 CODING_MODE_INHIBIT_UNENCODABLE_CHAR flag in terminal_coding.mode
17 instead of setting CODING_FLAG_ISO_SAFE flag in
18 terminal_coding.flags.
19
20 * coding.h (CODING_REPLACEMENT_CHARACTER): Renamed from
21 CODING_INHIBIT_CHARACTER_SUBSTITUTION.
22 (CODING_MODE_INHIBIT_UNENCODABLE_CHAR): New macro.
23
12003-05-28 Richard M. Stallman <rms@gnu.org> 242003-05-28 Richard M. Stallman <rms@gnu.org>
2 25
3 * print.c (syms_of_print) <print-escape-nonascii>: Doc fix. 26 * print.c (syms_of_print) <print-escape-nonascii>: Doc fix.
diff --git a/src/coding.c b/src/coding.c
index e329a228177..570715a2441 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -2036,6 +2036,78 @@ decode_coding_iso2022 (coding, source, destination, src_bytes, dst_bytes)
2036 } 2036 }
2037 continue; 2037 continue;
2038 2038
2039 case '%':
2040 if (COMPOSING_P (coding))
2041 DECODE_COMPOSITION_END ('1');
2042 ONE_MORE_BYTE (c1);
2043 if (c1 == '/')
2044 {
2045 /* CTEXT extended segment:
2046 ESC % / [0-4] M L --ENCODING-NAME-- \002 --BYTES--
2047 We keep these bytes as is for the moment.
2048 They may be decoded by post-read-conversion. */
2049 int dim, M, L;
2050 int size, required;
2051 int produced_chars;
2052
2053 ONE_MORE_BYTE (dim);
2054 ONE_MORE_BYTE (M);
2055 ONE_MORE_BYTE (L);
2056 size = ((M - 128) * 128) + (L - 128);
2057 required = 8 + size * 2;
2058 if (dst + required > (dst_bytes ? dst_end : src))
2059 goto label_end_of_loop;
2060 *dst++ = ISO_CODE_ESC;
2061 *dst++ = '%';
2062 *dst++ = '/';
2063 *dst++ = dim;
2064 produced_chars = 4;
2065 dst += CHAR_STRING (M, dst), produced_chars++;
2066 dst += CHAR_STRING (L, dst), produced_chars++;
2067 while (size-- > 0)
2068 {
2069 ONE_MORE_BYTE (c1);
2070 dst += CHAR_STRING (c1, dst), produced_chars++;
2071 }
2072 coding->produced_char += produced_chars;
2073 }
2074 else if (c1 == 'G')
2075 {
2076 unsigned char *d = dst;
2077 int produced_chars;
2078
2079 /* XFree86 extension for embedding UTF-8 in CTEXT:
2080 ESC % G --UTF-8-BYTES-- ESC % @
2081 We keep these bytes as is for the moment.
2082 They may be decoded by post-read-conversion. */
2083 if (d + 6 > (dst_bytes ? dst_end : src))
2084 goto label_end_of_loop;
2085 *d++ = ISO_CODE_ESC;
2086 *d++ = '%';
2087 *d++ = 'G';
2088 produced_chars = 3;
2089 while (d + 1 < (dst_bytes ? dst_end : src))
2090 {
2091 ONE_MORE_BYTE (c1);
2092 if (c1 == ISO_CODE_ESC
2093 && src + 1 < src_end
2094 && src[0] == '%'
2095 && src[1] == '@')
2096 break;
2097 d += CHAR_STRING (c1, d), produced_chars++;
2098 }
2099 if (d + 3 > (dst_bytes ? dst_end : src))
2100 goto label_end_of_loop;
2101 *d++ = ISO_CODE_ESC;
2102 *d++ = '%';
2103 *d++ = '@';
2104 dst = d;
2105 coding->produced_char += produced_chars + 3;
2106 }
2107 else
2108 goto label_invalid_code;
2109 continue;
2110
2039 default: 2111 default:
2040 if (! (coding->flags & CODING_FLAG_ISO_DESIGNATION)) 2112 if (! (coding->flags & CODING_FLAG_ISO_DESIGNATION))
2041 goto label_invalid_code; 2113 goto label_invalid_code;