[open-ils-commits] r17776 - trunk/Open-ILS/src/perlmods/OpenILS/Application (dbs)

svn at svn.open-ils.org svn at svn.open-ils.org
Fri Sep 17 15:39:42 EDT 2010


Author: dbs
Date: 2010-09-17 15:39:37 -0400 (Fri, 17 Sep 2010)
New Revision: 17776

Modified:
   trunk/Open-ILS/src/perlmods/OpenILS/Application/Vandelay.pm
Log:
Revert attempt to prevent encoding corruption that was causing encoding corruption

LDR/09 was never showing up as 'a' where it was being tested, and adding the
'a' was preventing a reconversion to UTF8. It somewhat looks like the UTF8
MARCXML input gets converted to MARC8 as part of MARC::Batch's magic, then
gets converted back to UTF8 by MARC::File::XML::as_xml_record(). Seems like
this would mean potential performance / encoding problems but it works, which
is better than what my meddlesome tests were doing.


Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Vandelay.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Vandelay.pm	2010-09-17 19:12:05 UTC (rev 17775)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Vandelay.pm	2010-09-17 19:39:37 UTC (rev 17776)
@@ -281,15 +281,6 @@
         $logger->info("processing record $count");
 
         try {
-            # Avoid an over-eager MARC::File::XML that may try to convert
-            # our record from MARC8 to UTF8 and break because the record
-            # is obviously already UTF8
-            my $ldr = $r->leader();
-            if (($marctype eq 'XML') && (substr($ldr, 9, 1) ne 'a')) {
-                $logger->warn("MARCXML record LDR/09 was not 'a'; record leader may be corrupt");
-                substr($ldr,9,1,'a');
-                $r->leader($ldr);
-            }
             (my $xml = $r->as_xml_record()) =~ s/\n//sog;
             $xml =~ s/^<\?xml.+\?\s*>//go;
             $xml =~ s/>\s+</></go;



More information about the open-ils-commits mailing list