diff src/hardcopy.c @ 819:23f82b5d2814 v7.0c10

updated for version 7.0c10
author vimboss
date Wed, 05 Apr 2006 20:41:53 +0000
parents 07f7b4a7755c
children 9ab23f1e137f
line wrap: on
line diff
--- a/src/hardcopy.c
+++ b/src/hardcopy.c
@@ -2473,6 +2473,7 @@ mch_print_init(psettings, jobname, force
     double      top;
     double      bottom;
 #ifdef FEAT_MBYTE
+    int         props;
     int         cmap;
     char_u	*p_encoding;
     struct prt_ps_encoding_S *p_mbenc;
@@ -2510,22 +2511,26 @@ mch_print_init(psettings, jobname, force
      * This is to cope with the fact that various unicode encodings are
      * supported in more than one of CJK. */
     p_mbenc = NULL;
-    p_mbenc_first = NULL;
-    p_mbchar = NULL;
-    for (cmap = 0; cmap < NUM_ELEMENTS(prt_ps_mbfonts); cmap++)
-        if (prt_match_encoding((char *)p_encoding, &prt_ps_mbfonts[cmap],
+    props = enc_canon_props(p_encoding);
+    if (!(props & ENC_8BIT) && (*p_penc != NUL || *p_pmcs != NUL))
+    {
+        p_mbenc_first = NULL;
+        p_mbchar = NULL;
+        for (cmap = 0; cmap < NUM_ELEMENTS(prt_ps_mbfonts); cmap++)
+            if (prt_match_encoding((char *)p_encoding, &prt_ps_mbfonts[cmap],
 								    &p_mbenc))
-        {
-            if (p_mbenc_first == NULL)
-                p_mbenc_first = p_mbenc;
-            if (prt_match_charset((char *)p_pmcs, &prt_ps_mbfonts[cmap],
+            {
+                if (p_mbenc_first == NULL)
+                    p_mbenc_first = p_mbenc;
+                if (prt_match_charset((char *)p_pmcs, &prt_ps_mbfonts[cmap],
 								   &p_mbchar))
-                break;
-        }
-
-    /* Use first encoding matched if no charset matched */
-    if (p_mbchar == NULL && p_mbenc_first != NULL)
-        p_mbenc = p_mbenc_first;
+                    break;
+            }
+
+        /* Use first encoding matched if no charset matched */
+        if (p_mbchar == NULL && p_mbenc_first != NULL)
+            p_mbenc = p_mbenc_first;
+    }
 
     prt_out_mbyte = (p_mbenc != NULL);
     if (prt_out_mbyte)