summaryrefslogtreecommitdiffstats
path: root/src/recode.c
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@dside.dyndns.org>2005-07-05 15:06:52 +0000
committerSuren A. Chilingaryan <csa@dside.dyndns.org>2005-07-05 15:06:52 +0000
commit550bda3e54a0895e027fee14860f14171a357ac9 (patch)
tree491fe42222b457dfb988f57f6dd190ab5fc9f5ff /src/recode.c
parent9922cef1af71786ae788903b52a8968e5775d510 (diff)
downloadlibrcc-550bda3e54a0895e027fee14860f14171a357ac9.tar.gz
librcc-550bda3e54a0895e027fee14860f14171a357ac9.tar.bz2
librcc-550bda3e54a0895e027fee14860f14171a357ac9.tar.xz
librcc-550bda3e54a0895e027fee14860f14171a357ac9.zip
Recoding Fixes
Diffstat (limited to 'src/recode.c')
-rw-r--r--src/recode.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/recode.c b/src/recode.c
index 80b59eb..f10221f 100644
--- a/src/recode.c
+++ b/src/recode.c
@@ -48,7 +48,8 @@ rcc_string rccFrom(rcc_context ctx, rcc_class_id class_id, const char *buf, int
// DS: Learning. check database (language_id)
charset_id = rccIConvAuto(ctx, class_id, buf, len);
- if (charset_id > 0) icnv = ctx->iconv_auto[charset_id];
+ if (charset_id != (rcc_charset_id)-1) icnv = ctx->iconv_auto[charset_id];
+
if (icnv == (iconv_t)-1) {
icnv = ctx->iconv_from[class_id];
if (icnv == (iconv_t)-1) return NULL;
@@ -61,7 +62,7 @@ rcc_string rccFrom(rcc_context ctx, rcc_class_id class_id, const char *buf, int
if (err<=0) return NULL;
result = rccCreateString(language_id, ctx->tmpbuffer, err, rlen);
}
-
+
// DS: Learning. write database
return result;
@@ -88,7 +89,6 @@ char *rccTo(rcc_context ctx, rcc_class_id class_id, const rcc_string buf, int le
class_type = rccGetClassType(ctx, class_id);
if ((class_type == RCC_CLASS_FS)&&(rccGetOption(ctx, RCC_AUTODETECT_FS_NAMES))) {
- // DS: file_names (aut odetect fspath)
prefix = NULL; name = buf + sizeof(rcc_string_header);
err = rccFS0(NULL, buf, &prefix, &name);
if (!err) {