diff options
author | Bram Moolenaar <Bram@vim.org> | 2014-10-09 17:05:56 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2014-10-09 17:05:56 +0200 |
commit | f191d55ede59883b09b35bfe92ea6e2a63058369 (patch) | |
tree | 911c5d7804fcbafb9de5e7b2f53b17bd1e49cdd4 | |
parent | 6885694e82424e5edc88505450ec6eddbe7258eb (diff) | |
download | vim-git-f191d55ede59883b09b35bfe92ea6e2a63058369.tar.gz |
updated for version 7.4.471v7.4.471
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)
-rw-r--r-- | src/os_mswin.c | 22 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 24 insertions, 0 deletions
diff --git a/src/os_mswin.c b/src/os_mswin.c index 9151aef41..dff093976 100644 --- a/src/os_mswin.c +++ b/src/os_mswin.c @@ -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); diff --git a/src/version.c b/src/version.c index fca5cb653..3be907b11 100644 --- a/src/version.c +++ b/src/version.c @@ -742,6 +742,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 471, +/**/ 470, /**/ 469, |