Bug 6479 Converts all the serialseq variables to UTF-8.
authorFrédérick Capovilla <frederick.capovilla@sys-tech.net>
Tue, 7 Jun 2011 18:03:08 +0000 (14:03 -0400)
committerChris Cormack <chrisc@catalyst.net.nz>
Fri, 2 Sep 2011 18:31:03 +0000 (06:31 +1200)
Corrects a problem when an UTF-8 character is used in the serial
numbering formula. The encoding became incorrect when concatenating the
number in the subscriptionhistory table.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
To reproduce:
- Create subscription with numbering pattern N° {X}
- Receive 2 or more issues
- Check subscription summary page and manual history fields on the edit screen

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
serials/serials-edit.pl

index db7620c..9ecd09f 100755 (executable)
@@ -197,6 +197,11 @@ $template->param( subscriptions => \@subscriptionloop );
 
 if ( $op and $op eq 'serialchangestatus' ) {
 
+    # Convert serialseqs to UTF-8 to prevent encoding problems
+    foreach my $seq (@serialseqs) {
+        utf8::decode($seq) unless utf8::is_utf8($seq);
+    }
+
     my $newserial;
     for ( my $i = 0 ; $i <= $#serialids ; $i++ ) {
         my ($plan_date, $pub_date);