X-Git-Url: http://git.indexdata.com/?p=idzebra-moved-to-github.git;a=blobdiff_plain;f=index%2Fzaptterm.c;h=5e4edddaba6e2a3ba2ca2e8a595fcfd4c5c53ae0;hp=1fb46dcb4b0bb2a9a6c88a33974ff0be518d0656;hb=27bdd6aa26843aeac89f635ed495996088d8e8aa;hpb=6a0f9234f945bc4956e2bcef75f715661a9eba9a diff --git a/index/zaptterm.c b/index/zaptterm.c index 1fb46dc..5e4eddd 100644 --- a/index/zaptterm.c +++ b/index/zaptterm.c @@ -1,5 +1,5 @@ /* This file is part of the Zebra server. - Copyright (C) 1994-2009 Index Data + Copyright (C) 2004-2013 Index Data Zebra is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -17,6 +17,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#if HAVE_CONFIG_H +#include +#endif #include #include #include @@ -47,9 +50,13 @@ ZEBRA_RES zapt_term_to_utf8(ZebraHandle zh, Z_AttributesPlusTerm *zapt, &outbuf, &outleft); if (ret == (size_t)(-1)) { + int iconv_error = yaz_iconv_error(zh->iconv_to_utf8); + ret = yaz_iconv(zh->iconv_to_utf8, 0, 0, 0, 0); zebra_setError( - zh, + zh, + iconv_error == YAZ_ICONV_E2BIG ? + YAZ_BIB1_TOO_MANY_CHARS_IN_SEARCH_STATEMENT : YAZ_BIB1_QUERY_TERM_INCLUDES_CHARS_THAT_DO_NOT_TRANSLATE_INTO_, 0); return ZEBRA_FAIL;