To: vim-dev@vim.org Subject: Patch 7.2b.021 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 7.2b.021 Problem: Reloading doesn't read the BOM correctly. (Steve Gardner) Solution: Accept utf-8 BOM when specified file encoding is utf-8. Files: src/fileio.c *** ../vim-7.2b.020/src/fileio.c Tue Jul 8 11:36:30 2008 --- src/fileio.c Thu Jul 24 17:37:42 2008 *************** *** 5537,5543 **** int len = 2; if (p[0] == 0xef && p[1] == 0xbb && size >= 3 && p[2] == 0xbf ! && (flags == FIO_ALL || flags == 0)) { name = "utf-8"; /* EF BB BF */ len = 3; --- 5537,5543 ---- int len = 2; if (p[0] == 0xef && p[1] == 0xbb && size >= 3 && p[2] == 0xbf ! && (flags == FIO_ALL || flags == FIO_UTF8 || flags == 0)) { name = "utf-8"; /* EF BB BF */ len = 3; *** ../vim-7.2b.020/src/version.c Thu Jul 24 21:30:10 2008 --- src/version.c Thu Jul 24 22:07:56 2008 *************** *** 678,679 **** --- 678,681 ---- { /* Add new patch number below this line */ + /**/ + 21, /**/ -- Computers are not intelligent. They only think they are. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ download, build and distribute -- http://www.A-A-P.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///