Merge branch 'master' of ssh://git.indexdata.com/home/git/pub/irspy
authorMike Taylor <mike@miketaylor.org.uk>
Mon, 5 Jul 2010 17:39:13 +0000 (18:39 +0100)
committerMike Taylor <mike@miketaylor.org.uk>
Mon, 5 Jul 2010 17:39:13 +0000 (18:39 +0100)
Changes
lib/ZOOM/IRSpy/Test/Ping.pm
lib/ZOOM/IRSpy/Utils.pm

diff --git a/Changes b/Changes
index 3e5fec3..6e00ec0 100644 (file)
--- a/Changes
+++ b/Changes
@@ -39,6 +39,12 @@ Revision history for Perl extension ZOOM::IRSpy.
          you cannot search for record syntax "USmarc" if the server 
          response was in lowercase "usmarc".
        - Run only one instance of the IRSpy script at a time.
+       - Use iconv character-set name "UTF-8" rather than "UTF8" as
+         the latter is for some reason not supported by the iconv
+         package in the Macports collection.
+       - _irspy_identifier2target() recognises and allows for
+         comma-separated ZOOM-style options at the front of IRSpy
+         identifiers.
 
 1.01  Mon Jul 16 12:51:19 BST 2007
        - Web UI pages to add or upload a new target are now publicly
index 31b7f4d..2a97594 100644 (file)
@@ -13,7 +13,7 @@ our @ISA = qw(ZOOM::IRSpy::Test);
 use ZOOM::IRSpy::Utils qw(isodate);
 
 use Text::Iconv;
-my $conv = new Text::Iconv("LATIN1", "UTF8");
+my $conv = new Text::Iconv("LATIN1", "UTF-8");
 
 
 sub start {
index 9ead6b3..089e8e7 100644 (file)
@@ -285,13 +285,13 @@ sub _irspy_identifier2target {
     confess "_irspy_identifier2target(): id is undefined"
        if !defined $id;
 
-    my($protocol, $target) = ($id =~ /(.*?):(.*)/);
+    my($prefix, $protocol, $target) = ($id =~ /([^:]*,)?(.*?):(.*)/);
     if (uc($protocol) eq "Z39.50" || uc($protocol) eq "TCP") {
-       return "tcp:$target";
+       return "${prefix}tcp:$target";
     } elsif (uc($protocol) eq "SRU") {
-       return "sru=get,http:$target";
+       return "${prefix}sru=get,http:$target";
     } elsif (uc($protocol) eq "SRW") {
-       return "sru=srw,http:$target";
+       return "${prefix}sru=srw,http:$target";
     }
 
     warn "_irspy_identifier2target($id): unrecognised protocol '$protocol'";