</listitem>
</varlistentry>
+ <varlistentry><term>element <literal>client_query_charset</literal> (optional)</term>
+ <listitem>
+ <para>
+ If specified, a conversion from the character set given to UTF-8 is
+ performed by the generic frontend server. It is only executed for
+ Z39.50 search requests (SRU/Solr are assumed to be UTF-8 encoded already).
+ </para>
+ </listitem>
+ </varlistentry>
+
<varlistentry><term>element <literal>docpath</literal> (optional)</term>
<listitem>
<para>
<config>zebra.cfg</config>
<cql2rpn>pqf.properties</cql2rpn>
<docpath>xsl</docpath>
+ <client_query_charset>iso-8859-1</client_query_charset>
<stylesheet>xsl/default.xsl</stylesheet>
<maximumrecordsize>2000000</maximumrecordsize>
<retrievalinfo>
#include <yaz/yaz-util.h>
#include <yaz/pquery.h>
#include <yaz/oid_db.h>
-
+#include <yaz/query-charset.h>
#include <yaz/srw.h>
#include <yaz/backend.h>
#include <yaz/yaz-ccl.h>
bsrr->search_input = req->otherInfo;
bsrr->present_number = *req->mediumSetPresentNumber;
+ if (assoc->server && assoc->server->client_query_charset &&
+ req->query->which == Z_Query_type_1)
+ {
+ yaz_iconv_t cd =
+ yaz_iconv_open("UTF-8", assoc->server->client_query_charset);
+ if (cd)
+ {
+ yaz_query_charset_convert_rpnquery(req->query->u.type_1,
+ assoc->decode, cd);
+ yaz_iconv_close(cd);
+ }
+ }
+
if (assoc->server && assoc->server->cql_transform
&& req->query->which == Z_Query_type_104
&& req->query->u.type_104->which == Z_External_CQL)
char *directory;
char *docpath;
char *stylesheet;
+ char *client_query_charset;
yaz_retrieval_t retrieval;
struct gfs_server *next;
};
n->directory = 0;
n->docpath = 0;
n->stylesheet = 0;
+ n->client_query_charset = 0;
n->id = nmem_strdup_null(gfs_nmem, id);
n->retrieval = yaz_retrieval_create();
return n;
nmem_malloc(gfs_nmem, strlen(s) + 2);
sprintf(gfs->stylesheet, "/%s", s);
}
+ else if (!strcmp((const char *) ptr->name,
+ "client_query_charset"))
+ {
+ gfs->client_query_charset =
+ nmem_dup_xml_content(gfs_nmem, ptr->children);
+ }
else if (!strcmp((const char *) ptr->name, "explain"))
{
; /* being processed separately */