Karsten Hopp ea5abb
To: vim_dev@googlegroups.com
Karsten Hopp ea5abb
Subject: Patch 7.4.471
Karsten Hopp ea5abb
Fcc: outbox
Karsten Hopp ea5abb
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp ea5abb
Mime-Version: 1.0
Karsten Hopp ea5abb
Content-Type: text/plain; charset=UTF-8
Karsten Hopp ea5abb
Content-Transfer-Encoding: 8bit
Karsten Hopp ea5abb
------------
Karsten Hopp ea5abb
Karsten Hopp ea5abb
Patch 7.4.471
Karsten Hopp ea5abb
Problem:    MS-Windows: When printer name contains multi-byte, the name is
Karsten Hopp ea5abb
	    displayed as ???.
Karsten Hopp ea5abb
Solution:   Convert the printer name from the active codepage to 'encoding'.
Karsten Hopp ea5abb
	    (Yasuhiro Matsumoto)
Karsten Hopp ea5abb
Files:	    src/os_mswin.c
Karsten Hopp ea5abb
Karsten Hopp ea5abb
Karsten Hopp ea5abb
*** ../vim-7.4.470/src/os_mswin.c	2014-09-27 11:18:08.179520979 +0200
Karsten Hopp ea5abb
--- src/os_mswin.c	2014-10-09 17:03:20.500915911 +0200
Karsten Hopp ea5abb
***************
Karsten Hopp ea5abb
*** 1635,1645 ****
Karsten Hopp ea5abb
--- 1635,1667 ----
Karsten Hopp ea5abb
  	char_u	*printer_name = (char_u *)devname + devname->wDeviceOffset;
Karsten Hopp ea5abb
  	char_u	*port_name = (char_u *)devname +devname->wOutputOffset;
Karsten Hopp ea5abb
  	char_u	*text = _("to %s on %s");
Karsten Hopp ea5abb
+ #ifdef FEAT_MBYTE
Karsten Hopp ea5abb
+ 	char_u  *printer_name_orig = printer_name;
Karsten Hopp ea5abb
+ 	char_u	*port_name_orig = port_name;
Karsten Hopp ea5abb
  
Karsten Hopp ea5abb
+ 	if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
Karsten Hopp ea5abb
+ 	{
Karsten Hopp ea5abb
+ 	    char_u  *to_free = NULL;
Karsten Hopp ea5abb
+ 	    int     maxlen;
Karsten Hopp ea5abb
+ 
Karsten Hopp ea5abb
+ 	    acp_to_enc(printer_name, STRLEN(printer_name), &to_free, &maxlen);
Karsten Hopp ea5abb
+ 	    if (to_free != NULL)
Karsten Hopp ea5abb
+ 		printer_name = to_free;
Karsten Hopp ea5abb
+ 	    acp_to_enc(port_name, STRLEN(port_name), &to_free, &maxlen);
Karsten Hopp ea5abb
+ 	    if (to_free != NULL)
Karsten Hopp ea5abb
+ 		port_name = to_free;
Karsten Hopp ea5abb
+ 	}
Karsten Hopp ea5abb
+ #endif
Karsten Hopp ea5abb
  	prt_name = alloc((unsigned)(STRLEN(printer_name) + STRLEN(port_name)
Karsten Hopp ea5abb
  							     + STRLEN(text)));
Karsten Hopp ea5abb
  	if (prt_name != NULL)
Karsten Hopp ea5abb
  	    wsprintf(prt_name, text, printer_name, port_name);
Karsten Hopp ea5abb
+ #ifdef FEAT_MBYTE
Karsten Hopp ea5abb
+ 	if (printer_name != printer_name_orig)
Karsten Hopp ea5abb
+ 	    vim_free(printer_name);
Karsten Hopp ea5abb
+ 	if (port_name != port_name_orig)
Karsten Hopp ea5abb
+ 	    vim_free(port_name);
Karsten Hopp ea5abb
+ #endif
Karsten Hopp ea5abb
      }
Karsten Hopp ea5abb
      GlobalUnlock(prt_dlg.hDevNames);
Karsten Hopp ea5abb
  
Karsten Hopp ea5abb
*** ../vim-7.4.470/src/version.c	2014-10-09 15:37:02.492904600 +0200
Karsten Hopp ea5abb
--- src/version.c	2014-10-09 17:00:58.632915601 +0200
Karsten Hopp ea5abb
***************
Karsten Hopp ea5abb
*** 743,744 ****
Karsten Hopp ea5abb
--- 743,746 ----
Karsten Hopp ea5abb
  {   /* Add new patch number below this line */
Karsten Hopp ea5abb
+ /**/
Karsten Hopp ea5abb
+     471,
Karsten Hopp ea5abb
  /**/
Karsten Hopp ea5abb
Karsten Hopp ea5abb
-- 
Karsten Hopp ea5abb
"Marriage is the process of finding out what kind of man your wife
Karsten Hopp ea5abb
would have preferred"
Karsten Hopp ea5abb
Karsten Hopp ea5abb
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp ea5abb
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp ea5abb
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp ea5abb
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///