From 9c6d2887cd59552a64247426dbfddfc8a610b2ee Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Tue, 16 Jun 2009 01:17:10 +0000 Subject: [PATCH] (detect_coding_utf_16): Fix the logic of rejecting UTF-16 by checking the dispersion of Eth and Oth bytes. --- src/coding.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/coding.c b/src/coding.c index 8c43929693e..8d90297db0f 100644 --- a/src/coding.c +++ b/src/coding.c @@ -1677,14 +1677,14 @@ detect_coding_utf_16 (coding, detect_info) { e[c1] = 1; e_num++; - if (e_num >= 128) + if (e_num >= 128 && o_num >= 128) break; } if (! o[c2]) { o[c2] = 1; o_num++; - if (o_num >= 128) + if (e_num >= 128 && o_num >= 128) break; } } -- 2.39.2