annotate src/libguess/turkish_impl.c @ 4405:15c491f342eb

Rename bmp_rcfile* -> aud_rcfile*
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 31 Mar 2008 06:23:31 +0300
parents 6bcfc6561711
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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 }