Fixed iconv problem, causing truncated words when using iso locale
This commit is contained in:
parent
a1bbfb0129
commit
66161f5249
@ -1,10 +1,11 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
ChangeLog - 2007-01-07
|
||||
ChangeLog - 2007-01-08
|
||||
|
||||
|
||||
Version 0.2.3 (under dev!):
|
||||
* fixed iconv problem, causing truncated words when using iso locale
|
||||
* fixed topic scroll when topic has multi-bytes chars
|
||||
* fixed compilation problem with iconv under FreeBSD
|
||||
* fixed bugs with charset: now decodes/encodes nicks and channels in IRC
|
||||
|
@ -200,10 +200,8 @@ weechat_iconv (char *from_code, char *to_code, char *string)
|
||||
|
||||
#ifdef HAVE_ICONV
|
||||
iconv_t cd;
|
||||
char *inbuf;
|
||||
char *inbuf, *ptr_inbuf, *ptr_outbuf, *next_char;
|
||||
int done;
|
||||
char *ptr_inbuf;
|
||||
char *ptr_outbuf;
|
||||
size_t err, inbytesleft, outbytesleft;
|
||||
|
||||
if (from_code && from_code[0] && to_code && to_code[0]
|
||||
@ -236,7 +234,20 @@ weechat_iconv (char *from_code, char *to_code, char *string)
|
||||
done = 1;
|
||||
break;
|
||||
case EILSEQ:
|
||||
ptr_inbuf[0] = '?';
|
||||
next_char = utf8_next_char (ptr_inbuf);
|
||||
if (next_char)
|
||||
{
|
||||
inbytesleft -= next_char - ptr_inbuf;
|
||||
ptr_inbuf = next_char;
|
||||
}
|
||||
else
|
||||
{
|
||||
inbytesleft--;
|
||||
ptr_inbuf++;
|
||||
}
|
||||
ptr_outbuf[0] = '?';
|
||||
ptr_outbuf++;
|
||||
outbytesleft--;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,11 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
ChangeLog - 2007-01-07
|
||||
ChangeLog - 2007-01-08
|
||||
|
||||
|
||||
Version 0.2.3 (under dev!):
|
||||
* fixed iconv problem, causing truncated words when using iso locale
|
||||
* fixed topic scroll when topic has multi-bytes chars
|
||||
* fixed compilation problem with iconv under FreeBSD
|
||||
* fixed bugs with charset: now decodes/encodes nicks and channels in IRC
|
||||
|
@ -200,10 +200,8 @@ weechat_iconv (char *from_code, char *to_code, char *string)
|
||||
|
||||
#ifdef HAVE_ICONV
|
||||
iconv_t cd;
|
||||
char *inbuf;
|
||||
char *inbuf, *ptr_inbuf, *ptr_outbuf, *next_char;
|
||||
int done;
|
||||
char *ptr_inbuf;
|
||||
char *ptr_outbuf;
|
||||
size_t err, inbytesleft, outbytesleft;
|
||||
|
||||
if (from_code && from_code[0] && to_code && to_code[0]
|
||||
@ -236,7 +234,20 @@ weechat_iconv (char *from_code, char *to_code, char *string)
|
||||
done = 1;
|
||||
break;
|
||||
case EILSEQ:
|
||||
ptr_inbuf[0] = '?';
|
||||
next_char = utf8_next_char (ptr_inbuf);
|
||||
if (next_char)
|
||||
{
|
||||
inbytesleft -= next_char - ptr_inbuf;
|
||||
ptr_inbuf = next_char;
|
||||
}
|
||||
else
|
||||
{
|
||||
inbytesleft--;
|
||||
ptr_inbuf++;
|
||||
}
|
||||
ptr_outbuf[0] = '?';
|
||||
ptr_outbuf++;
|
||||
outbytesleft--;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user