20 |
|
|
21 |
QECharset *first_charset = NULL; |
QECharset *first_charset = NULL; |
22 |
|
|
23 |
extern QECharset charset_7bit; |
static QECharset charset_7bit; |
24 |
|
|
25 |
/* specific tables */ |
/* specific tables */ |
26 |
static unsigned short table_idem[256]; |
static unsigned short table_idem[256]; |
171 |
const unsigned char *p; |
const unsigned char *p; |
172 |
int i, l; |
int i, l; |
173 |
|
|
174 |
p = *pp; |
p = *(const unsigned char**)pp; |
175 |
c = *p++; |
c = *p++; |
176 |
if (c < 128) { |
if (c < 128) { |
177 |
/* fast case for ASCII */ |
/* fast case for ASCII */ |
194 |
c == 0xfffe || c == 0xffff) |
c == 0xfffe || c == 0xffff) |
195 |
goto fail; |
goto fail; |
196 |
} |
} |
197 |
*pp = p; |
*(const unsigned char**)pp = p; |
198 |
return c; |
return c; |
199 |
fail: |
fail: |
200 |
*pp = p; |
*(const unsigned char**)pp = p; |
201 |
return INVALID_CHAR; |
return INVALID_CHAR; |
202 |
} |
} |
203 |
|
|
270 |
|
|
271 |
unsigned char *encode_utf8(QECharset *charset, unsigned char *q, int c) |
unsigned char *encode_utf8(QECharset *charset, unsigned char *q, int c) |
272 |
{ |
{ |
273 |
return utf8_encode(q, c); |
return (unsigned char*)utf8_encode((char*)q, c); |
274 |
} |
} |
275 |
|
|
276 |
static const char *aliases_utf_8[] = { "utf8", NULL }; |
static const char *aliases_utf_8[] = { "utf8", NULL }; |
368 |
{ |
{ |
369 |
char *q; |
char *q; |
370 |
|
|
371 |
q = charset->encode_func(charset, buf, c); |
q = (char *)charset->encode_func(charset, (unsigned char*)buf, c); |
372 |
if (!q) { |
if (!q) { |
373 |
q = buf; |
q = buf; |
374 |
*q++ ='?'; |
*q++ ='?'; |