Mercurial > vim
changeset 1547:e72e30c69d58 v7.1.261
updated for version 7.1-261
author | vimboss |
---|---|
date | Wed, 20 Feb 2008 17:15:26 +0000 |
parents | 75f5889a5d8e |
children | 8d74df00f7da |
files | src/fileio.c src/testdir/test42.ok src/version.c |
diffstat | 3 files changed, 6 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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) + /* 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 - name = "ucs-2"; /* FE FF */ } else if (size >= 4 && p[0] == 0 && p[1] == 0 && p[2] == 0xfe && p[3] == 0xff && (flags == FIO_ALL || flags == FIO_UCS4))