Merge branch 'master' of ssh://us2.indexdata.com/home/quinn/proj/pazpar2
authorAdam Dickmeiss <adam@indexdata.dk>
Mon, 21 Jul 2008 10:02:40 +0000 (12:02 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Mon, 21 Jul 2008 10:02:40 +0000 (12:02 +0200)
doc/pazpar2_conf.xml
src/http.c

index 1472f7f..745cab4 100644 (file)
   <!-- Retrieval settings -->
 
   <set name="pz:requestsyntax" value="marc21"/>
-  <!-- <set name="pz:elements" value="F"/> NOT YET IMPLEMENTED -->
+  <set name="pz:elements" value="F"/>
+
+  <!-- Query encoding -->
+  <set name="pz:queryencoding" value="iso-8859-1"/>
 
   <!-- Result normalization settings -->
 
      <listitem>
       <para>
        The element set name to be used when retrieving records from a
-       server (not yet implemented).
+       server.
       </para>
      </listitem>
     </varlistentry>
       </para>
      </listitem>
     </varlistentry>
+
+    <varlistentry>
+     <term>pz:queryencoding</term>
+     <listitem>
+      <para>
+        The encoding of the search terms that a target accepts. Most
+        targets do not honor UTF-8 in which case this needs to be specified.
+        Each term in a query will be converted if this setting is given.
+      </para>
+     </listitem>
+    </varlistentry>
+
     <varlistentry>
      <term>pz:xslt</term>
      <listitem>
index 642465f..ec72838 100644 (file)
@@ -230,12 +230,13 @@ static void urldecode(char *i, char *o)
             *(o++) = ' ';
             i++;
         }
-        else if (*i == '%')
+        else if (*i == '%' && i[1] && i[2])
         {
+            int v;
             i++;
-            sscanf(i, "%2hhx", o);
+            sscanf(i, "%2x", &v);
+            *o++ = v;
             i += 2;
-            o++;
         }
         else
             *(o++) = *(i++);