Rev 7044 | Rev 7057 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 7044 | Rev 7045 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | //#include |
1 | #include |
2 | //#include |
2 | //#include |
3 | typedef unsigned int size_t; |
3 | typedef unsigned int size_t; |
4 | #define NULL ((void*)0) |
4 | #define NULL ((void*)0) |
Line 5... | Line 5... | ||
5 | 5 | ||
Line 28... | Line 28... | ||
28 | #define CP1252 2 |
28 | #define CP1252 2 |
29 | #define KOI8_RU 3 |
29 | #define KOI8_RU 3 |
30 | #define ISO8859_5 4 |
30 | #define ISO8859_5 4 |
31 | #define UTF_8 5 |
31 | #define UTF_8 5 |
Line 32... | Line -... | ||
32 | - | ||
33 | - | ||
34 | int strcmp (const char* a, const char* b) |
- | |
35 | { |
- | |
36 | return (*a && *b && (*a == *b)) ? ((*(a+1) || *(b+1)) ? (strcmp(a+1, b+1)) : (0)) : ((*a > *b) ? (1) : (-1)); |
- | |
37 | } |
- | |
38 | - | ||
39 | - | ||
40 | - | ||
41 | 32 | ||
42 | #include "cp866.h" |
33 | #include "cp866.h" |
43 | #include "cp1251.h" |
34 | #include "cp1251.h" |
44 | #include "cp1252.h" |
35 | #include "cp1252.h" |
45 | #include "koi8_ru.h" |
36 | #include "koi8_ru.h" |
46 | #include "iso8859_5.h" |
37 | #include "iso8859_5.h" |
Line 47... | Line -... | ||
47 | #include "utf8.h" |
- | |
48 | 38 | #include "utf8.h" |
|
Line 49... | Line 39... | ||
49 | 39 | ||
50 | int encoding(char *what) { |
40 | int encoding(char *what) { |
51 | 41 | ||
Line 56... | Line 46... | ||
56 | what[i] = '\0'; |
46 | what[i] = '\0'; |
57 | break; |
47 | break; |
58 | } |
48 | } |
59 | } |
49 | } |
Line 60... | Line 50... | ||
60 | 50 | ||
61 | if (!strcmp(what,"CP866")) return CP866; |
51 | if (!strcasecmp(what,"CP866")) return CP866; |
62 | if (!strcmp(what,"CP1251")) return CP1251; |
52 | if (!strcasecmp(what,"CP1251")) return CP1251; |
63 | if (!strcmp(what,"windows-1252")) return CP1252; |
- | |
64 | if (!strcmp(what,"Windows-1252")) return CP1252; |
53 | if (!strcasecmp(what,"windows-1252")) return CP1252; |
65 | if (!strcmp(what,"CP1252")) return CP1252; |
54 | if (!strcasecmp(what,"CP1252")) return CP1252; |
66 | if (!strcmp(what,"KOI8-RU")) return KOI8_RU; |
55 | if (!strcasecmp(what,"KOI8-RU")) return KOI8_RU; |
67 | if (!strcmp(what,"ISO8859-5")) return ISO8859_5; |
56 | if (!strcasecmp(what,"ISO8859-5")) return ISO8859_5; |
68 | if (!strcmp(what,"UTF-8")) return UTF_8; |
57 | if (!strcasecmp(what,"UTF-8")) return UTF_8; |
69 | return -1; |
58 | return -1; |
Line 70... | Line 59... | ||
70 | } |
59 | } |