changeset 104537:4f700f983ef9

(encode_coding_string): Don't encode unibyte strings. (Bug#4047)
author Eli Zaretskii <eliz@gnu.org>
date Sat, 22 Aug 2009 10:23:52 +0000
parents 232bd5c831d5
children 328a5fd88053
files src/coding.h
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/coding.h	Sat Aug 22 09:07:08 2009 +0000
+++ b/src/coding.h	Sat Aug 22 10:23:52 2009 +0000
@@ -738,9 +738,10 @@
 			SBYTES (string), Qt)
 
 #define encode_coding_string(coding, string, nocopy)			\
-  (encode_coding_object (coding, string, 0, 0, SCHARS (string),		\
-			 SBYTES (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)		\