comparison src/coding.c @ 103441:d08523c14cca

(detect_coding_utf_16): Fix the logic of rejecting UTF-16 by checking the dispersion of Eth and Oth bytes.
author Kenichi Handa <handa@m17n.org>
date Tue, 16 Jun 2009 01:17:10 +0000
parents 45564d023acc
children db4ec1a977bd
comparison
equal deleted inserted replaced
103440:1bddb7afc319 103441:d08523c14cca
1675 break; 1675 break;
1676 if (! e[c1]) 1676 if (! e[c1])
1677 { 1677 {
1678 e[c1] = 1; 1678 e[c1] = 1;
1679 e_num++; 1679 e_num++;
1680 if (e_num >= 128) 1680 if (e_num >= 128 && o_num >= 128)
1681 break; 1681 break;
1682 } 1682 }
1683 if (! o[c2]) 1683 if (! o[c2])
1684 { 1684 {
1685 o[c2] = 1; 1685 o[c2] = 1;
1686 o_num++; 1686 o_num++;
1687 if (o_num >= 128) 1687 if (e_num >= 128 && o_num >= 128)
1688 break; 1688 break;
1689 } 1689 }
1690 } 1690 }
1691 detect_info->rejected |= CATEGORY_MASK_UTF_16; 1691 detect_info->rejected |= CATEGORY_MASK_UTF_16;
1692 return 0; 1692 return 0;