summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/fileio.c7
-rw-r--r--src/testdir/test42.okbin407 -> 310 bytes
-rw-r--r--src/version.c2
3 files changed, 6 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))
diff --git a/src/testdir/test42.ok b/src/testdir/test42.ok
index 16f41e46e..643b75bc9 100644
--- a/src/testdir/test42.ok
+++ b/src/testdir/test42.ok
Binary files differ
diff --git a/src/version.c b/src/version.c
index 26bfaa2d7..fd5901449 100644
--- a/src/version.c
+++ b/src/version.c
@@ -667,6 +667,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 261,
+/**/
260,
/**/
259,