Mercurial > libguess
annotate turkish_impl.c @ 2:754a4550c64e
- added arabic, greek, hebrew and turkish DFAs
- new UCS-2LE/BE DFAs
- now arabic_impl.c uses arabic DFAs
- dfa common macros have been moved to dfa.h
- minor cleanups
author | Yoshiki Yazawa <yaz@cc.rim.or.jp> |
---|---|
date | Wed, 11 Jun 2008 00:11:30 +0900 |
parents | d9b6ff839eab |
children | 70e2c306231e |
rev | line source |
---|---|
0 | 1 #include "libguess.h" |
2 | |
3 static const char *_guess_tr(const unsigned char *ptr, int size) | |
4 { | |
5 int i; | |
6 | |
7 for (i = 0; i < size; i++) | |
8 { | |
2
754a4550c64e
- added arabic, greek, hebrew and turkish DFAs
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
9 if (ptr[i] == 0x80 || |
0 | 10 (ptr[i] >= 0x82 && ptr[i] <= 0x8C) || |
2
754a4550c64e
- added arabic, greek, hebrew and turkish DFAs
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
11 (ptr[i] >= 0x91 && ptr[i] <= 0x9C) || |
0 | 12 ptr[ i ] == 0x9F) |
13 return "CP1254"; | |
14 } | |
15 | |
16 return "ISO-8859-9"; | |
17 } | |
18 | |
19 const char *guess_tr(const char *ptr, int size) | |
20 { | |
21 if (dfa_validate_utf8(ptr, size)) | |
22 return "UTF-8"; | |
23 | |
24 return _guess_tr((const unsigned char *)ptr, size); | |
25 } |