home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 6.2.346 < prev    next >
Encoding:
Internet Message Format  |  2004-03-10  |  2.0 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.2.346
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. Mime-Version: 1.0
  6. Content-Type: text/plain; charset=ISO-8859-1
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 6.2.346
  11. Problem:    Win32 console: After using "chcp" Vim does not detect the
  12.         different codepage.
  13. Solution:   Use GetConsoleCP() and when it is different from GetACP() set
  14.         'termencoding'.
  15. Files:        src/option.c
  16.  
  17.  
  18. *** ../vim-6.2.345/src/option.c    Sun Mar  7 19:33:37 2004
  19. --- src/option.c    Thu Mar 11 17:25:32 2004
  20. ***************
  21. *** 2803,2808 ****
  22. --- 2803,2828 ----
  23.           opt_idx = findoption((char_u *)"encoding");
  24.           options[opt_idx].def_val[VI_DEFAULT] = p_enc;
  25.           options[opt_idx].flags |= P_DEF_ALLOCED;
  26. + # if defined(WIN3264) && !defined(FEAT_GUI)
  27. +         /* Win32 console: When GetACP() returns a different value from
  28. +          * GetConsoleCP() set 'termencoding'. */
  29. +         if (GetACP() != GetConsoleCP())
  30. +         {
  31. +         char    buf[50];
  32. +         sprintf(buf, "cp%ld", (long)GetConsoleCP());
  33. +         p_tenc = vim_strsave((char_u *)buf);
  34. +         if (p_tenc != NULL)
  35. +         {
  36. +             opt_idx = findoption((char_u *)"termencoding");
  37. +             options[opt_idx].def_val[VI_DEFAULT] = p_tenc;
  38. +             options[opt_idx].flags |= P_DEF_ALLOCED;
  39. +         }
  40. +         else
  41. +             p_tenc = empty_option;
  42. +         }
  43. + # endif
  44.       }
  45.       else
  46.       {
  47. *** ../vim-6.2.345/src/version.c    Thu Mar 11 21:03:40 2004
  48. --- src/version.c    Thu Mar 11 21:07:08 2004
  49. ***************
  50. *** 639,640 ****
  51. --- 639,642 ----
  52.   {   /* Add new patch number below this line */
  53. + /**/
  54. +     346,
  55.   /**/
  56.  
  57. -- 
  58. hundred-and-one symptoms of being an internet addict:
  59. 8. You spend half of the plane trip with your laptop on your lap...and your
  60.    child in the overhead compartment.
  61.  
  62.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  63. ///        Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  64. \\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
  65.  \\\  Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///
  66.