|
a/src/unac/unac.c |
|
b/src/unac/unac.c |
|
... |
|
... |
12729 |
|
12729 |
|
12730 |
if((cd = iconv_open(to, from)) == (iconv_t)-1) {
|
12730 |
if((cd = iconv_open(to, from)) == (iconv_t)-1) {
|
12731 |
return -1;
|
12731 |
return -1;
|
12732 |
}
|
12732 |
}
|
12733 |
do {
|
12733 |
do {
|
12734 |
if(iconv(cd, (ICONV_CONST char **) &in, &in_length, &out, &out_remain) == (size_t)-1) {
|
12734 |
if(iconv(cd, &in, &in_length, &out, &out_remain) == (size_t)-1) {
|
12735 |
switch(errno) {
|
12735 |
switch(errno) {
|
12736 |
case EILSEQ:
|
12736 |
case EILSEQ:
|
12737 |
/*
|
12737 |
/*
|
12738 |
* If an illegal sequence is found in the context of unac_string
|
12738 |
* If an illegal sequence is found in the context of unac_string
|
12739 |
* it means the unaccented version of a character contains
|
12739 |
* it means the unaccented version of a character contains
|
|
... |
|
... |
12754 |
*
|
12754 |
*
|
12755 |
*/
|
12755 |
*/
|
12756 |
if(from_utf16) {
|
12756 |
if(from_utf16) {
|
12757 |
const char* tmp = space;
|
12757 |
const char* tmp = space;
|
12758 |
size_t tmp_length = 2;
|
12758 |
size_t tmp_length = 2;
|
12759 |
if(iconv(cd, (ICONV_CONST char **) &tmp, &tmp_length, &out, &out_remain) == (size_t)-1) {
|
12759 |
if(iconv(cd, &tmp, &tmp_length, &out, &out_remain) == (size_t)-1) {
|
12760 |
if(errno == E2BIG)
|
12760 |
if(errno == E2BIG)
|
12761 |
/* fall thru to the E2BIG case below */;
|
12761 |
/* fall thru to the E2BIG case below */;
|
12762 |
else
|
12762 |
else
|
12763 |
return -1;
|
12763 |
return -1;
|
12764 |
} else {
|
12764 |
} else {
|