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.283 < prev    next >
Encoding:
Internet Message Format  |  2004-02-19  |  2.4 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.2.283
  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.283
  11. Problem:    The "local additions" in help.txt are used without conversion,
  12.         causing latin1 characters showing up wrong when 'enc' is utf-8.
  13.         (Antoine J. Mechelynck)
  14. Solution:   Convert the text to 'encoding'.
  15. Files:        src/ex_cmds.c
  16.  
  17.  
  18. *** ../vim-6.2.282/src/ex_cmds.c    Fri Feb 20 22:04:18 2004
  19. --- src/ex_cmds.c    Fri Feb 20 22:00:08 2004
  20. ***************
  21. *** 5003,5008 ****
  22. --- 5031,5040 ----
  23.               FILE    *fd;
  24.               char_u    *s;
  25.               int    fi;
  26. + #ifdef FEAT_MBYTE
  27. +             vimconv_T    vc;
  28. +             char_u        *cp;
  29. + #endif
  30.   
  31.               /* Find all "doc/ *.txt" files in this directory. */
  32.               add_pathsep(NameBuff);
  33. ***************
  34. *** 5031,5038 ****
  35. --- 5063,5096 ----
  36.                           *s = NUL;
  37.                           ++s;
  38.                       }
  39. + #ifdef FEAT_MBYTE
  40. +                     /* Assume the help file is latin1 and
  41. +                      * conversion to the current
  42. +                      * 'encoding' may be required. */
  43. +                     vc.vc_type = CONV_NONE;
  44. +                     convert_setup(&vc,
  45. +                            (char_u *)"latin1", p_enc);
  46. +                     if (vc.vc_type == CONV_NONE)
  47. +                         /* No conversion needed. */
  48. +                         cp = IObuff;
  49. +                     else
  50. +                     {
  51. +                         /* Do the conversion.  If it fails
  52. +                          * use the unconverted text. */
  53. +                         cp = string_convert(&vc, IObuff,
  54. +                                     NULL);
  55. +                         if (cp == NULL)
  56. +                         cp = IObuff;
  57. +                     }
  58. +                     convert_setup(&vc, NULL, NULL);
  59. +                     ml_append(lnum, cp, (colnr_T)0, FALSE);
  60. +                     if (cp != IObuff)
  61. +                         vim_free(cp);
  62. + #else
  63.                       ml_append(lnum, IObuff, (colnr_T)0,
  64.                                          FALSE);
  65. + #endif
  66.                       ++lnum;
  67.                       }
  68.                       fclose(fd);
  69. *** ../vim-6.2.282/src/version.c    Fri Feb 20 22:04:18 2004
  70. --- src/version.c    Fri Feb 20 22:06:21 2004
  71. ***************
  72. *** 639,640 ****
  73. --- 639,642 ----
  74.   {   /* Add new patch number below this line */
  75. + /**/
  76. +     283,
  77.   /**/
  78.  
  79. -- 
  80. hundred-and-one symptoms of being an internet addict:
  81. 206. You religiously respond immediately to e-mail, while ignoring
  82.      your growing pile of snail mail.
  83.  
  84.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  85. ///        Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  86. \\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
  87.  \\\  Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html  ///
  88.