]> code.delx.au - gnu-emacs/blobdiff - src/coding.h
* doc/lispref/modes.texi (Defining Minor Modes): Use C-backspace, not C-delete.
[gnu-emacs] / src / coding.h
index 3e89ff10421d042ff37c3b5ee39b24dc526b27a3..f47c33847f963842c0320cdb156192559747141f 100644 (file)
@@ -1,8 +1,8 @@
 /* Header for coding system handler.
    Copyright (C) 2001, 2002, 2003, 2004, 2005,
-                 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
+                 2006, 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
    Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-     2005, 2006, 2007, 2008, 2009
+     2005, 2006, 2007, 2008, 2009, 2010
      National Institute of Advanced Industrial Science and Technology (AIST)
      Registration Number H14PRO021
    Copyright (C) 2003
@@ -735,12 +735,13 @@ extern void encode_coding_object P_ ((struct coding_system *,
 
 #define decode_coding_string(coding, string, nocopy)                   \
   decode_coding_object (coding, string, 0, 0, SCHARS (string),         \
-                       STRING_BYTES (XSTRING (string)), Qt)
+                       SBYTES (string), Qt)
 
 #define encode_coding_string(coding, string, nocopy)                   \
-  (encode_coding_object (coding, string, 0, 0, SCHARS (string),                \
-                        STRING_BYTES (XSTRING (string)), Qt),          \
-   (coding)->dst_object)
+  (STRING_MULTIBYTE(string) ?                                          \
+    (encode_coding_object (coding, string, 0, 0, SCHARS (string),      \
+                          SBYTES (string), Qt),                        \
+     (coding)->dst_object) : (string))
 
 
 #define decode_coding_c_string(coding, src, bytes, dst_object)         \