Mercurial > hg > xemacs-beta
comparison src/mule-coding.c @ 3393:96ec8f16af45
[xemacs-hg @ 2006-05-11 08:57:59 by stephent]
Improve detection of ISO-8-1 coding systems. <874pzx2bn2.fsf@tleepslib.sk.tsukuba.ac.jp>
author | stephent |
---|---|
date | Thu, 11 May 2006 08:58:01 +0000 |
parents | aaf96f4ba612 |
children | d1754e7f0cea |
comparison
equal
deleted
inserted
replaced
3392:824c3c18a129 | 3393:96ec8f16af45 |
---|---|
2925 DET_RESULT (st, iso_8_2) = DET_SLIGHTLY_LIKELY; | 2925 DET_RESULT (st, iso_8_2) = DET_SLIGHTLY_LIKELY; |
2926 #endif | 2926 #endif |
2927 } | 2927 } |
2928 else if (data->odd_high_byte_groups > 0 && | 2928 else if (data->odd_high_byte_groups > 0 && |
2929 data->even_high_byte_groups > 0) | 2929 data->even_high_byte_groups > 0) |
2930 SET_DET_RESULTS (st, iso2022, DET_SOMEWHAT_UNLIKELY); | 2930 { |
2931 /* Well, this could be a Latin-1 text, with most high-byte | |
2932 characters single, but sometimes two are together, though | |
2933 this happens not as often. This is common for Western | |
2934 European languages like German, French, Danish, Swedish, etc. | |
2935 Then we would either have a rather small file and | |
2936 even_high_byte_groups would be low. | |
2937 Or we would have a larger file and the ratio of odd to even | |
2938 groups would be very high. */ | |
2939 SET_DET_RESULTS (st, iso2022, DET_SOMEWHAT_UNLIKELY); | |
2940 if (data->even_high_byte_groups <= 3 || | |
2941 data->odd_high_byte_groups >= 10 * data->even_high_byte_groups) | |
2942 DET_RESULT (st, iso_8_1) = DET_SOMEWHAT_LIKELY; | |
2943 } | |
2931 else | 2944 else |
2932 SET_DET_RESULTS (st, iso2022, DET_AS_LIKELY_AS_UNLIKELY); | 2945 SET_DET_RESULTS (st, iso2022, DET_AS_LIKELY_AS_UNLIKELY); |
2933 } | 2946 } |
2934 | 2947 |
2935 static void | 2948 static void |