comparison src/libguess/hebrew_impl.c @ 3215:ce2d24746c09 trunk

Add support for greek and hebrew character set detection.
author William Pitcock <nenolod@atheme-project.org>
date Thu, 02 Aug 2007 02:00:21 -0500
parents
children
comparison
equal deleted inserted replaced
3214:faf6daa29d5c 3215:ce2d24746c09
1 const char *_guess_hw(const unsigned char *ptr, int size)
2 {
3 int i;
4
5 for (i = 0; i < size; i++)
6 {
7 if (ptr[i] == 0x80 || (ptr[i] >= 0x82 && ptr[i] <= 0x89) || ptr[i] == 0x8B ||
8 (ptr[i] >= 0x91 && ptr[i] <= 0x99) || ptr[i] == 0x9B || ptr[i] == 0xA1 ||
9 (ptr[i] >= 0xBF && ptr[i] <= 0xC9) ||
10 (ptr[i] >= 0xCB && ptr[i] <= 0xD8))
11 return "CP1255";
12
13 if (ptr[i] == 0xDF)
14 return "ISO-8859-8-I";
15 }
16
17 return "ISO-8859-8-I";
18 }
19
20 const char *guess_hw(const char *ptr, int size)
21 {
22 return _guess_hw((const unsigned char *) ptr, size);
23 }