From: Adam Dickmeiss Date: Mon, 19 May 2003 14:37:38 +0000 (+0000) Subject: odr_set_charset: allow to==from==0 to disable charset conversion X-Git-Tag: YAZ.2.0.2.RH.2~20 X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=commitdiff_plain;h=94f604cea006e77285967d3e2f8a2ee32db7c434 odr_set_charset: allow to==from==0 to disable charset conversion --- diff --git a/odr/odr.c b/odr/odr.c index 7bd3fae..948043c 100644 --- a/odr/odr.c +++ b/odr/odr.c @@ -2,7 +2,7 @@ * Copyright (c) 1995-2003, Index Data * See the file LICENSE for details. * - * $Id: odr.c,v 1.41 2003-03-11 11:03:31 adam Exp $ + * $Id: odr.c,v 1.42 2003-05-19 14:37:38 adam Exp $ * */ #if HAVE_CONFIG_H @@ -76,10 +76,13 @@ int odr_set_charset(ODR o, const char *to, const char *from) { if (o->op->iconv_handle) yaz_iconv_close (o->op->iconv_handle); - - o->op->iconv_handle = yaz_iconv_open (to, from); - if (o->op->iconv_handle == 0) - return -1; + o->op->iconv_handle = 0; + if (to && from) + { + o->op->iconv_handle = yaz_iconv_open (to, from); + if (o->op->iconv_handle == 0) + return -1; + } return 0; }