LP#1442276 Prevent corrupted Unicode chars in MARCTXT and RIS
authorDan Scott <dscott@laurentian.ca>
Fri, 3 Mar 2017 06:40:19 +0000 (01:40 -0500)
committerDan Scott <dscott@laurentian.ca>
Sun, 12 Mar 2017 04:09:58 +0000 (23:09 -0500)
The MARCTXT and RIS feeds use the deprecated XML::LibXSLT::output_string()
method which, depending on the stylesheet, generated either a byte string
or characters. Using output_as_bytes() ensures it is always a byte string
and avoids the resulting MARCTXT and RIS output from corrupting Unicode
characters.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>

Open-ILS/src/perlmods/lib/OpenILS/WWW/SuperCat/Feed.pm

index 2cb401f..56146cb 100644 (file)
@@ -793,7 +793,7 @@ sub toString {
         searchClass => "'$class'",
     );
 
-    return $marctxt_xslt->output_string($new_doc); 
+    return $marctxt_xslt->output_as_bytes($new_doc);
 }
 
 
@@ -845,7 +845,7 @@ sub toString {
         searchClass => "'$class'",
     );
 
-    return $ris_xslt->output_string($new_doc); 
+    return $ris_xslt->output_as_bytes($new_doc);
 }