]> granicus.if.org Git - vim/commitdiff
updated for version 7.4.471 v7.4.471
authorBram Moolenaar <Bram@vim.org>
Thu, 9 Oct 2014 15:05:56 +0000 (17:05 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 9 Oct 2014 15:05:56 +0000 (17:05 +0200)
Problem:    MS-Windows: When printer name contains multi-byte, the name is
            displayed as ???.
Solution:   Convert the printer name from the active codepage to 'encoding'.
            (Yasuhiro Matsumoto)

src/os_mswin.c
src/version.c

index 9151aef4147ae320246a7d49d75fc3294f922bdd..dff0939764036e0ab461ea9ddb21d6bf771aaa30 100644 (file)
@@ -1635,11 +1635,33 @@ mch_print_init(prt_settings_T *psettings, char_u *jobname, int forceit)
        char_u  *printer_name = (char_u *)devname + devname->wDeviceOffset;
        char_u  *port_name = (char_u *)devname +devname->wOutputOffset;
        char_u  *text = _("to %s on %s");
+#ifdef FEAT_MBYTE
+       char_u  *printer_name_orig = printer_name;
+       char_u  *port_name_orig = port_name;
 
+       if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
+       {
+           char_u  *to_free = NULL;
+           int     maxlen;
+
+           acp_to_enc(printer_name, STRLEN(printer_name), &to_free, &maxlen);
+           if (to_free != NULL)
+               printer_name = to_free;
+           acp_to_enc(port_name, STRLEN(port_name), &to_free, &maxlen);
+           if (to_free != NULL)
+               port_name = to_free;
+       }
+#endif
        prt_name = alloc((unsigned)(STRLEN(printer_name) + STRLEN(port_name)
                                                             + STRLEN(text)));
        if (prt_name != NULL)
            wsprintf(prt_name, text, printer_name, port_name);
+#ifdef FEAT_MBYTE
+       if (printer_name != printer_name_orig)
+           vim_free(printer_name);
+       if (port_name != port_name_orig)
+           vim_free(port_name);
+#endif
     }
     GlobalUnlock(prt_dlg.hDevNames);
 
index fca5cb65362328bbaa13c42f863deb66effb7f10..3be907b118646db38aedd4f7574830bae362ef6b 100644 (file)
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    471,
 /**/
     470,
 /**/