changeset 110338:c32e93d8bf05

coding.c (encode_coding_iso_2022): Do not optimize for ASCII if we may use designation or locking-shift.
author Kenichi Handa <handa@m17n.org>
date Wed, 08 Sep 2010 11:22:40 +0900
parents 08056547de92 (current diff) 3ffb3b102dae (diff)
children 594a5c140233
files
diffstat 2 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Tue Sep 07 20:23:04 2010 +0900
+++ b/src/ChangeLog	Wed Sep 08 11:22:40 2010 +0900
@@ -1,3 +1,8 @@
+2010-09-08  Kenichi Handa  <handa@m17n.org>
+
+	* coding.c (encode_coding_iso_2022): Don't optimize for ASCII if
+	we may use designation or locking-shift.
+
 2010-09-07  Kenichi Handa  <handa@m17n.org>
 
 	* coding.c (detect_coding_emacs_mule): Fix checking of multibyte
--- a/src/coding.c	Tue Sep 07 20:23:04 2010 +0900
+++ b/src/coding.c	Wed Sep 08 11:22:40 2010 +0900
@@ -4528,7 +4528,10 @@
   charset_list = CODING_ATTR_CHARSET_LIST (attrs);
   coding->safe_charsets = SDATA (CODING_ATTR_SAFE_CHARSETS (attrs));
 
-  ascii_compatible = ! NILP (CODING_ATTR_ASCII_COMPAT (attrs));
+  ascii_compatible
+    = (! NILP (CODING_ATTR_ASCII_COMPAT (attrs))
+       && ! (CODING_ISO_FLAGS (coding) & (CODING_ISO_FLAG_DESIGNATION
+					  | CODING_ISO_FLAG_LOCKING_SHIFT)));
 
   while (charbuf < charbuf_end)
     {