Add ccl_transform element to struct gfs_server.
[yaz-moved-to-github.git] / src / srwutil.c
index af507b1..b115ffc 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (C) 1995-2007, Index Data ApS
  * See the file LICENSE for details.
  *
- * $Id: srwutil.c,v 1.57 2007-05-23 11:54:47 adam Exp $
+ * $Id: srwutil.c,v 1.59 2007-05-24 10:18:36 adam Exp $
  */
 /**
  * \file srwutil.c
@@ -28,8 +28,9 @@ void encode_uri_char(char *dst, char ch)
 {
     if (ch == ' ')
         strcpy(dst, "+");
+    /*  mark        = "-" | "_" | "." | "!" | "~" | "*" | "'" | "(" | ")" */
     else if ((ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z') ||
-        (ch >= '0' && ch <= '9'))
+             (ch >= '0' && ch <= '9') || strchr("-_.!~*'(|)", ch))
     {
         dst[0] = ch;
         dst[1] = '\0';
@@ -1344,11 +1345,11 @@ const char *yaz_srw_pack_to_str(int pack)
 
 int yaz_srw_str_to_pack(const char *str)
 {
-    if (!strcmp(str, "string"))
+    if (!yaz_matchstr(str, "string"))
         return Z_SRW_recordPacking_string;
-    if (!strcmp(str, "xml"))
+    if (!yaz_matchstr(str, "xml"))
         return Z_SRW_recordPacking_XML;
-    if (!strcmp(str, "url"))
+    if (!yaz_matchstr(str, "url"))
         return Z_SRW_recordPacking_URL;
     return -1;
 }