From 537c4b33fdf6e143243d5a0d286eeb247362e806 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Mon, 18 Jul 2005 15:22:28 +0000 Subject: API Improvements - Removed 'rlen' return parameters there not necessary for multibyte encodings - Two versions of recode functions: rccRecode -> rccRecode, rccSizedRecode - Class Types: CONST, SKIP_SAVELOAD - New recode functions: rccToCharset, rccFromCharset - More new recode functions: rccRecodeToCharset, rccRecodeFromCharset, rccRecodeCharsets - New function: rccGetCompiledConfiguration - All warnings are fixed - Perform "File Name" search only if there are non ISO8859-1 chars in the name. - Do not copy invalid characters, - skip them. - Fixed error in rccRecode with 'Recoding Cache' switched On. - Strip leading and trailing spaces in rccDB4 get/set --- src/rcciconv.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/rcciconv.c') diff --git a/src/rcciconv.c b/src/rcciconv.c index 1add9d9..65b32b3 100644 --- a/src/rcciconv.c +++ b/src/rcciconv.c @@ -9,11 +9,11 @@ static void rccIConvCopySymbol(char **in_buf, int *in_left, char **out_buf, int *out_left) { if ((out_left>0)&&(in_left>0)) { - (**out_buf)=(**in_buf); +/* (**out_buf)=(**in_buf); (*out_buf)++; + (*out_left)--;*/ (*in_buf)++; (*in_left)--; - (*out_left)--; } } @@ -49,16 +49,16 @@ void rccIConvClose(rcc_iconv icnv) { } size_t rccIConvRecode(rcc_iconv icnv, char *outbuf, size_t outsize, const char *buf, size_t size) { - char *in_buf, *out_buf, *res, err; - int in_left, out_left, olen; + char *in_buf, *out_buf, err; + int in_left, out_left; int ub, utf_mode=0; int errors=0; if ((!buf)||(!outbuf)||(!outsize)||(!icnv)||(icnv->icnv == (iconv_t)-1)) return (size_t)-1; if (iconv(icnv->icnv, NULL, NULL, NULL, NULL) == -1) return (size_t)-1; - size = STRNLEN(buf,size); - + if (!size) size = strlen(buf); + loop_restart: errors = 0; in_buf = (char*)buf; /*DS*/ -- cgit v1.2.3