[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/src/coding.c
From: |
Kenichi Handa |
Subject: |
[Emacs-diffs] Changes to emacs/src/coding.c |
Date: |
Thu, 22 May 2003 01:53:23 -0400 |
Index: emacs/src/coding.c
diff -c emacs/src/coding.c:1.278 emacs/src/coding.c:1.279
*** emacs/src/coding.c:1.278 Mon May 19 09:02:39 2003
--- emacs/src/coding.c Thu May 22 01:53:23 2003
***************
*** 2301,2311 ****
/* Instead of encoding character C, produce one or two `?'s. */
! #define ENCODE_UNSAFE_CHARACTER(c) \
! do {
\
! ENCODE_ISO_CHARACTER (CODING_INHIBIT_CHARACTER_SUBSTITUTION); \
! if (CHARSET_WIDTH (CHAR_CHARSET (c)) > 1) \
! ENCODE_ISO_CHARACTER (CODING_INHIBIT_CHARACTER_SUBSTITUTION); \
} while (0)
--- 2301,2311 ----
/* Instead of encoding character C, produce one or two `?'s. */
! #define ENCODE_UNSAFE_CHARACTER(c) \
! do { \
! ENCODE_ISO_CHARACTER (CODING_REPLACEMENT_CHARACTER); \
! if (CHARSET_WIDTH (CHAR_CHARSET (c)) > 1) \
! ENCODE_ISO_CHARACTER (CODING_REPLACEMENT_CHARACTER); \
} while (0)
***************
*** 2534,2539 ****
--- 2534,2542 ----
Lisp_Object translation_table;
Lisp_Object safe_chars;
+ if (coding->flags & CODING_FLAG_ISO_SAFE)
+ coding->mode |= CODING_MODE_INHIBIT_UNENCODABLE_CHAR;
+
safe_chars = coding_safe_chars (coding->symbol);
if (NILP (Venable_character_translation))
***************
*** 2601,2607 ****
}
else
{
! if (coding->flags & CODING_FLAG_ISO_SAFE
&& ! CODING_SAFE_CHAR_P (safe_chars, c))
ENCODE_UNSAFE_CHARACTER (c);
else
--- 2604,2610 ----
}
else
{
! if (coding->mode & CODING_MODE_INHIBIT_UNENCODABLE_CHAR
&& ! CODING_SAFE_CHAR_P (safe_chars, c))
ENCODE_UNSAFE_CHARACTER (c);
else
***************
*** 2670,2676 ****
*dst++ = c;
coding->errors++;
}
! else if (coding->flags & CODING_FLAG_ISO_SAFE
&& ! CODING_SAFE_CHAR_P (safe_chars, c))
ENCODE_UNSAFE_CHARACTER (c);
else
--- 2673,2679 ----
*dst++ = c;
coding->errors++;
}
! else if (coding->mode & CODING_MODE_INHIBIT_UNENCODABLE_CHAR
&& ! CODING_SAFE_CHAR_P (safe_chars, c))
ENCODE_UNSAFE_CHARACTER (c);
else
***************
*** 3113,3118 ****
--- 3116,3127 ----
EMIT_ONE_BYTE (c1 | 0x80);
else if (charset == charset_latin_jisx0201)
EMIT_ONE_BYTE (c1);
+ else if (coding->mode & CODING_MODE_INHIBIT_UNENCODABLE_CHAR)
+ {
+ EMIT_ONE_BYTE (CODING_REPLACEMENT_CHARACTER);
+ if (CHARSET_WIDTH (charset) > 1)
+ EMIT_ONE_BYTE (CODING_REPLACEMENT_CHARACTER);
+ }
else
/* There's no way other than producing the internal
codes as is. */
***************
*** 3125,3130 ****
--- 3134,3145 ----
ENCODE_BIG5 (charset, c1, c2, c1, c2);
EMIT_TWO_BYTES (c1, c2);
}
+ else if (coding->mode & CODING_MODE_INHIBIT_UNENCODABLE_CHAR)
+ {
+ EMIT_ONE_BYTE (CODING_REPLACEMENT_CHARACTER);
+ if (CHARSET_WIDTH (charset) > 1)
+ EMIT_ONE_BYTE (CODING_REPLACEMENT_CHARACTER);
+ }
else
/* There's no way other than producing the internal
codes as is. */
***************
*** 7023,7029 ****
CHECK_SYMBOL (coding_system);
setup_coding_system (Fcheck_coding_system (coding_system),
&terminal_coding);
/* We had better not send unsafe characters to terminal. */
! terminal_coding.flags |= CODING_FLAG_ISO_SAFE;
/* Character composition should be disabled. */
terminal_coding.composing = COMPOSITION_DISABLED;
/* Error notification should be suppressed. */
--- 7038,7044 ----
CHECK_SYMBOL (coding_system);
setup_coding_system (Fcheck_coding_system (coding_system),
&terminal_coding);
/* We had better not send unsafe characters to terminal. */
! terminal_coding.mode |= CODING_MODE_INHIBIT_UNENCODABLE_CHAR;
/* Character composition should be disabled. */
terminal_coding.composing = COMPOSITION_DISABLED;
/* Error notification should be suppressed. */
- [Emacs-diffs] Changes to emacs/src/coding.c, Kenichi Handa, 2003/05/01
- [Emacs-diffs] Changes to emacs/src/coding.c, Kenichi Handa, 2003/05/06
- [Emacs-diffs] Changes to emacs/src/coding.c, Kenichi Handa, 2003/05/06
- [Emacs-diffs] Changes to emacs/src/coding.c, Dave Love, 2003/05/08
- [Emacs-diffs] Changes to emacs/src/coding.c, Kenichi Handa, 2003/05/19
- [Emacs-diffs] Changes to emacs/src/coding.c, Kenichi Handa, 2003/05/20
- [Emacs-diffs] Changes to emacs/src/coding.c,
Kenichi Handa <=
- [Emacs-diffs] Changes to emacs/src/coding.c, Andreas Schwab, 2003/05/24
- [Emacs-diffs] Changes to emacs/src/coding.c, Stefan Monnier, 2003/05/25
- [Emacs-diffs] Changes to emacs/src/coding.c, Kenichi Handa, 2003/05/28
- [Emacs-diffs] Changes to emacs/src/coding.c, Kenichi Handa, 2003/05/28
- [Emacs-diffs] Changes to emacs/src/coding.c, Kenichi Handa, 2003/05/28
- [Emacs-diffs] Changes to emacs/src/coding.c, Kenichi Handa, 2003/05/29
- [Emacs-diffs] Changes to emacs/src/coding.c, Kenichi Handa, 2003/05/30
- [Emacs-diffs] Changes to emacs/src/coding.c, Kenichi Handa, 2003/05/30
- [Emacs-diffs] Changes to emacs/src/coding.c, Kenichi Handa, 2003/05/30