When printer name contains multi-byte, the name is displayed as ???.

diff -r e861ee614a3a src/os_mswin.c
--- a/src/os_mswin.c    Wed Sep 24 10:58:20 2014 +0900
+++ b/src/os_mswin.c    Fri Sep 26 15:09:46 2014 +0900
@@ -1635,11 +1635,30 @@
    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, *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);

- Yasuhiro Matsumoto

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui