From: Adam Dickmeiss Date: Fri, 15 Jan 2010 09:43:30 +0000 (+0100) Subject: New setting pz:negotiation_charset . X-Git-Tag: v1.3.0~14 X-Git-Url: http://git.indexdata.com/?a=commitdiff_plain;h=46dfee528ed8d8b304918491799e36f112e05cda;hp=e59e5b2f02ff8e38c5da9f5c9450370c9d1e2dd9;p=pazpar2-moved-to-github.git New setting pz:negotiation_charset . Patch from Andrei V. Toutoukine: new setting pz:negotiation_charset which specifies character set for Z39.50 Init. --- diff --git a/doc/pazpar2_conf.xml b/doc/pazpar2_conf.xml index aa49f9a..7997c66 100644 --- a/doc/pazpar2_conf.xml +++ b/doc/pazpar2_conf.xml @@ -841,6 +841,17 @@ + pz:negotiation_charset + + + Sets character set for Z39.50 negotiation. Most targets do not support + this, and some will even close connection if set (crash on server + side or similar). If set, the value is most likely to be "UTF-8". + + + + + pz:xslt diff --git a/src/connection.c b/src/connection.c index 5e6dae3..f318378 100644 --- a/src/connection.c +++ b/src/connection.c @@ -346,6 +346,7 @@ static int connection_connect(struct connection *con) struct host *host = connection_get_host(con); ZOOM_options zoptions = ZOOM_options_create(); const char *auth; + const char *charset; const char *sru; const char *sru_version = 0; @@ -359,6 +360,10 @@ static int connection_connect(struct connection *con) ZOOM_options_set(zoptions, "async", "1"); ZOOM_options_set(zoptions, "implementationName", PACKAGE_NAME); ZOOM_options_set(zoptions, "implementationVersion", VERSION); + + if ((charset = session_setting_oneval(sdb, PZ_NEGOTIATION_CHARSET))) + ZOOM_options_set(zoptions, "charset", charset); + if (zproxy && *zproxy) { con->zproxy = xstrdup(zproxy); diff --git a/src/settings.c b/src/settings.c index 7e25f20..83441d5 100644 --- a/src/settings.c +++ b/src/settings.c @@ -68,6 +68,7 @@ static char *hard_settings[] = { "pz:sort", "pz:recordfilter", "pz:pqf_strftime", + "pz:negotiation_charset", 0 }; diff --git a/src/settings.h b/src/settings.h index 8f16dc3..b7bf53d 100644 --- a/src/settings.h +++ b/src/settings.h @@ -41,6 +41,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #define PZ_SORT 18 #define PZ_RECORDFILTER 19 #define PZ_PQF_STRFTIME 20 +#define PZ_NEGOTIATION_CHARSET 21 struct setting {