JiaYanwei wrote: > For a 2 byte BOM "FF FE", "ucs-2le" is used, which doesn't work for > little-endian UTF-16 text. Like the patch 7.1.261, the only difference is the > byte order. > And I have also writen a patch for Vim-7.2.025: > > *** ../vim-7.2.025/src/fileio.c Wed Oct 15 15:09:56 2008 > --- src/fileio.c Sat Oct 18 11:42:25 2008 > *************** > *** 5550,5559 **** > name = "ucs-4le"; /* FF FE 00 00 */ > len = 4; > } > ! else if (flags == FIO_ALL || flags == (FIO_UCS2 | FIO_ENDIAN_L)) > ! name = "ucs-2le"; /* FF FE */ > ! else if (flags == (FIO_UTF16 | FIO_ENDIAN_L)) > name = "utf-16le"; /* FF FE */ > } > else if (p[0] == 0xfe && p[1] == 0xff > && (flags == FIO_ALL || flags == FIO_UCS2 || flags == FIO_UTF16)) > --- 5550,5561 ---- > name = "ucs-4le"; /* FF FE 00 00 */ > len = 4; > } > ! > /* For little endian: default to utf-16, it works also for ucs-2 text. */ > ! else if (flags == FIO_ALL || flags == (FIO_UTF16 | FIO_ENDIAN_L)) > name = "utf-16le"; /* FF FE */ > + else if (flags == (FIO_UCS2 | FIO_ENDIAN_L)) > + name = "ucs-2le"; /* FF FE */ > + > } > else if (p[0] == 0xfe && p[1] == 0xff > && (flags == FIO_ALL || flags == FIO_UCS2 || flags == FIO_UTF16)) > -- > Best regards, > Yanwe > > I also see this problem for UTF-16LE files using Vim-7.2.025 for (Windows console version). This patch fixes it for me, excellent. Thanks Yanwe.
--David --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
