Rev 7007 | Rev 7045 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 7007 | Rev 7044 | ||
---|---|---|---|
Line 59... | Line 59... | ||
59 | } |
59 | } |
Line 60... | Line 60... | ||
60 | 60 | ||
61 | if (!strcmp(what,"CP866")) return CP866; |
61 | if (!strcmp(what,"CP866")) return CP866; |
62 | if (!strcmp(what,"CP1251")) return CP1251; |
62 | if (!strcmp(what,"CP1251")) return CP1251; |
- | 63 | if (!strcmp(what,"windows-1252")) return CP1252; |
|
63 | if (!strcmp(what,"windows-1252")) return CP1252; |
64 | if (!strcmp(what,"Windows-1252")) return CP1252; |
64 | if (!strcmp(what,"CP1252")) return CP1252; |
65 | if (!strcmp(what,"CP1252")) return CP1252; |
65 | if (!strcmp(what,"KOI8-RU")) return KOI8_RU; |
66 | if (!strcmp(what,"KOI8-RU")) return KOI8_RU; |
66 | if (!strcmp(what,"ISO8859-5")) return ISO8859_5; |
67 | if (!strcmp(what,"ISO8859-5")) return ISO8859_5; |
67 | if (!strcmp(what,"UTF-8")) return UTF_8; |
68 | if (!strcmp(what,"UTF-8")) return UTF_8; |
68 | return -1; |
69 | return -1; |
Line 69... | Line 70... | ||
69 | } |
70 | } |
70 | 71 | ||
- | 72 | ||
71 | 73 | iconv_t iconv_open(const char *tocode, const char *fromcode) { |
|
72 | iconv_t iconv_open(const char *tocode, const char *fromcode) { |
74 | int to, from; |
- | 75 | ||
73 | int to, from; |
76 | if ((to=encoding(tocode))==-1) return -1; |
74 | if ((to=encoding(tocode))==-1) return -1; |
77 | if ((from=encoding(fromcode))==-1) return -1; |
75 | if ((from=encoding(fromcode))==-1) return -1; |
78 | |
76 | to=to<<16&0xFFFF0000; |
79 | to=to<<16&0xFFFF0000; |
Line 156... | Line 159... | ||
156 | 159 | ||
Line 157... | Line 160... | ||
157 | //printf("Conv:%d Wri:%d In:%d Out:%d UTF:%x UCS:%x 866:%s\n",converted, written, *inbytesleft,*outbytesleft,*((*inbuf)+count1),pwc, str); |
160 | //printf("Conv:%d Wri:%d In:%d Out:%d UTF:%x UCS:%x 866:%s\n",converted, written, *inbytesleft,*outbytesleft,*((*inbuf)+count1),pwc, str); |
158 | 161 | ||
- | 162 | (*inbytesleft)-=converted; |
|
159 | (*inbytesleft)-=converted; |
163 | (*outbytesleft)-=written; |
160 | (*outbytesleft)-=written; |
164 | (*outbuf)+=written; |
161 | count1+=converted; |
165 | count1+=converted; |
162 | count2+=written; |
166 | count2+=written; |