changeset 89967:cf5499fb503f

(x_to_w32_font): Update to use new coding struct.
author Jason Rumney <jasonr@gnu.org>
date Wed, 01 Sep 2004 21:20:10 +0000
parents d8411455de48
children 1e9fa4848335
files src/w32fns.c
diffstat 1 files changed, 7 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/w32fns.c	Fri Aug 27 07:00:34 2004 +0000
+++ b/src/w32fns.c	Wed Sep 01 21:20:10 2004 +0000
@@ -5398,19 +5398,17 @@
 
       if (fields > 0 && name[0] != '*')
         {
+	  Lisp_Object string = build_string (name);
           setup_coding_system
             (Fcheck_coding_system (Vlocale_coding_system), &coding);
-	  coding.src_multibyte = 1;
-	  coding.dst_multibyte = 1;
-	  coding.dst_bytes = strlen (name) * 2;
-	  coding.destination = (unsigned char *) xmalloc (coding.dst_bytes);
+          coding.mode |= (CODING_MODE_SAFE_ENCODING | CODING_MODE_LAST_BLOCK);
 	  /* Disable composition/charset annotation.   */
 	  coding.common_flags &= ~CODING_ANNOTATION_MASK;
-	  if (coding.type == coding_type_iso2022)
-	    coding.flags |= CODING_FLAG_ISO_SAFE;
-          coding.mode |= CODING_MODE_LAST_BLOCK;
-          encode_coding_object (&coding, build_string (name), 0, 0,
-				strlen (name), coding.dst_bytes, Qnil);
+	  coding.dst_bytes = SCHARS (string) * 2;
+
+	  coding.destination = (unsigned char *) xmalloc (coding.dst_bytes);
+          encode_coding_object (&coding, string, 0, 0,
+				SCHARS (string), SBYTES (string), Qnil);
 	  if (coding.produced >= LF_FACESIZE)
 	    coding.produced = LF_FACESIZE - 1;