| To: vim-dev@vim.org |
| Subject: Patch 7.2.033 |
| Fcc: outbox |
| From: Bram Moolenaar <Bram@moolenaar.net> |
| Mime-Version: 1.0 |
| Content-Type: text/plain; charset=ISO-8859-1 |
| Content-Transfer-Encoding: 8bit |
| |
| |
| Patch 7.2.033 |
| Problem: When detecting a little endian BOM "ucs-2le" is used, but the text |
| might be "utf-16le". |
| Solution: Default to "utf-16le", it also works for "ucs-2le". (Jia Yanwei) |
| Files: src/fileio.c, src/testdir/test42.ok |
| |
| |
| |
| |
| |
| *** 5550,5558 **** |
| 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 |
| --- 5550,5559 ---- |
| name = "ucs-4le"; /* FF FE 00 00 */ |
| len = 4; |
| } |
| ! else if (flags == (FIO_UCS2 | FIO_ENDIAN_L)) |
| name = "ucs-2le"; /* FF FE */ |
| ! else if (flags == FIO_ALL || flags == (FIO_UTF16 | FIO_ENDIAN_L)) |
| ! /* utf-16le is preferred, it also works for ucs-2le text */ |
| name = "utf-16le"; /* FF FE */ |
| } |
| else if (p[0] == 0xfe && p[1] == 0xff |
| |
| |
| |
| *** 20,26 **** |
| ucs-2 |
| |
| |
| ! fileencoding=ucs-2le |
| bomb |
| ucs-2le |
| |
| --- 20,26 ---- |
| ucs-2 |
| |
| |
| ! fileencoding=utf-16le |
| bomb |
| ucs-2le |
| |
| |
| |
| |
| *** 678,679 **** |
| --- 678,681 ---- |
| { /* Add new patch number below this line */ |
| + /**/ |
| + 33, |
| /**/ |
| |
| -- |
| hundred-and-one symptoms of being an internet addict: |
| 234. You started college as a chemistry major, and walk out four years |
| later as an Internet provider. |
| |
| /// 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 /// |