diff options
author | Bram Moolenaar <Bram@vim.org> | 2008-02-20 17:15:26 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2008-02-20 17:15:26 +0000 |
commit | ffd82c530766c02f76cbdd9db80adb853859e10b (patch) | |
tree | 2469a12b6454fcd077bf1376e7b6baea19e0197c /src/fileio.c | |
parent | 9c33a7c971279b77fe4fc74076f5735b88ead71b (diff) | |
download | vim-git-ffd82c530766c02f76cbdd9db80adb853859e10b.tar.gz |
updated for version 7.1-261v7.1.261
Diffstat (limited to 'src/fileio.c')
-rw-r--r-- | src/fileio.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/fileio.c b/src/fileio.c index 40905cfea..fbb3ada47 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -5514,10 +5514,11 @@ check_for_bom(p, size, lenp, flags) else if (p[0] == 0xfe && p[1] == 0xff && (flags == FIO_ALL || flags == FIO_UCS2 || flags == FIO_UTF16)) { - if (flags == FIO_UTF16) - name = "utf-16"; /* FE FF */ - else + /* Default to utf-16, it works also for ucs-2 text. */ + if (flags == FIO_UCS2) name = "ucs-2"; /* FE FF */ + else + name = "utf-16"; /* FE FF */ } else if (size >= 4 && p[0] == 0 && p[1] == 0 && p[2] == 0xfe && p[3] == 0xff && (flags == FIO_ALL || flags == FIO_UCS4)) |