Mercurial > audlegacy
annotate src/libguess/turkish_impl.c @ 3957:fed07be6b708
every other menu shows on button press..
| author | Tomasz Mon <desowin@gmail.com> |
|---|---|
| date | Fri, 16 Nov 2007 15:20:07 +0100 |
| parents | 6bcfc6561711 |
| children |
| rev | line source |
|---|---|
|
3206
6bcfc6561711
Implement support for Arabic and Turkish.
William Pitcock <nenolod@atheme-project.org>
parents:
diff
changeset
|
1 #include "libguess.h" |
|
6bcfc6561711
Implement support for Arabic and Turkish.
William Pitcock <nenolod@atheme-project.org>
parents:
diff
changeset
|
2 |
|
6bcfc6561711
Implement support for Arabic and Turkish.
William Pitcock <nenolod@atheme-project.org>
parents:
diff
changeset
|
3 static const char *_guess_tr(const unsigned char *ptr, int size) |
|
6bcfc6561711
Implement support for Arabic and Turkish.
William Pitcock <nenolod@atheme-project.org>
parents:
diff
changeset
|
4 { |
|
6bcfc6561711
Implement support for Arabic and Turkish.
William Pitcock <nenolod@atheme-project.org>
parents:
diff
changeset
|
5 int i; |
|
6bcfc6561711
Implement support for Arabic and Turkish.
William Pitcock <nenolod@atheme-project.org>
parents:
diff
changeset
|
6 |
|
6bcfc6561711
Implement support for Arabic and Turkish.
William Pitcock <nenolod@atheme-project.org>
parents:
diff
changeset
|
7 for (i = 0; i < size; i++) |
|
6bcfc6561711
Implement support for Arabic and Turkish.
William Pitcock <nenolod@atheme-project.org>
parents:
diff
changeset
|
8 { |
|
6bcfc6561711
Implement support for Arabic and Turkish.
William Pitcock <nenolod@atheme-project.org>
parents:
diff
changeset
|
9 if (ptr[i] == 0x80 || |
|
6bcfc6561711
Implement support for Arabic and Turkish.
William Pitcock <nenolod@atheme-project.org>
parents:
diff
changeset
|
10 (ptr[i] >= 0x82 && ptr[i] <= 0x8C) || |
|
6bcfc6561711
Implement support for Arabic and Turkish.
William Pitcock <nenolod@atheme-project.org>
parents:
diff
changeset
|
11 (ptr[i] >= 0x91 && ptr[i] <= 0x9C) || |
|
6bcfc6561711
Implement support for Arabic and Turkish.
William Pitcock <nenolod@atheme-project.org>
parents:
diff
changeset
|
12 ptr[ i ] == 0x9F) |
|
6bcfc6561711
Implement support for Arabic and Turkish.
William Pitcock <nenolod@atheme-project.org>
parents:
diff
changeset
|
13 return "CP1254"; |
|
6bcfc6561711
Implement support for Arabic and Turkish.
William Pitcock <nenolod@atheme-project.org>
parents:
diff
changeset
|
14 } |
|
6bcfc6561711
Implement support for Arabic and Turkish.
William Pitcock <nenolod@atheme-project.org>
parents:
diff
changeset
|
15 |
|
6bcfc6561711
Implement support for Arabic and Turkish.
William Pitcock <nenolod@atheme-project.org>
parents:
diff
changeset
|
16 return "ISO-8859-9"; |
|
6bcfc6561711
Implement support for Arabic and Turkish.
William Pitcock <nenolod@atheme-project.org>
parents:
diff
changeset
|
17 } |
|
6bcfc6561711
Implement support for Arabic and Turkish.
William Pitcock <nenolod@atheme-project.org>
parents:
diff
changeset
|
18 |
|
6bcfc6561711
Implement support for Arabic and Turkish.
William Pitcock <nenolod@atheme-project.org>
parents:
diff
changeset
|
19 const char *guess_tr(const char *ptr, int size) |
|
6bcfc6561711
Implement support for Arabic and Turkish.
William Pitcock <nenolod@atheme-project.org>
parents:
diff
changeset
|
20 { |
|
6bcfc6561711
Implement support for Arabic and Turkish.
William Pitcock <nenolod@atheme-project.org>
parents:
diff
changeset
|
21 if (dfa_validate_utf8(ptr, size)) |
|
6bcfc6561711
Implement support for Arabic and Turkish.
William Pitcock <nenolod@atheme-project.org>
parents:
diff
changeset
|
22 return "UTF-8"; |
|
6bcfc6561711
Implement support for Arabic and Turkish.
William Pitcock <nenolod@atheme-project.org>
parents:
diff
changeset
|
23 |
|
6bcfc6561711
Implement support for Arabic and Turkish.
William Pitcock <nenolod@atheme-project.org>
parents:
diff
changeset
|
24 return _guess_tr((const unsigned char *)ptr, size); |
|
6bcfc6561711
Implement support for Arabic and Turkish.
William Pitcock <nenolod@atheme-project.org>
parents:
diff
changeset
|
25 } |
