From dfd43ee49fbf3e1359436f0d18e7bedbcf11633b Mon Sep 17 00:00:00 2001 From: Patrick von der Hagen Date: Wed, 16 Mar 2016 14:32:27 +0100 Subject: [PATCH] Fixed Unicode-bug according to https://foswiki.org/Tasks/Item13483 BibliographyPlugin has been identified to have Unicode-issues since foswiki-core changed to utf-8. The in-memory-filehandle has been identifed as the problem, so I replaced it with a simple split (consuming more memory, but not breaking Unicode. --- .../Plugins/BibliographyPlugin/Core.pm | 22 +++---------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/lib/Foswiki/Plugins/BibliographyPlugin/Core.pm b/lib/Foswiki/Plugins/BibliographyPlugin/Core.pm index a636a85..f838675 100644 --- a/lib/Foswiki/Plugins/BibliographyPlugin/Core.pm +++ b/lib/Foswiki/Plugins/BibliographyPlugin/Core.pm @@ -373,25 +373,9 @@ sub _parseBibliographyTopics { my $text = $topicObject->text(); if ($text) { - - # Use a $fh rather than loope over a split(/[\r\n]+/ - # ... so we save a little memory - if ( - open my $text_fh, - '<:encoding(' - . ( $Foswiki::cfg{Site}{CharSet} || 'iso-8859-1' ) . ')', - \$text - ) - { - while ( my $line = <$text_fh> ) { - _parseline($line); - } - ASSERT( close($text_fh), - '_parseBibliographyTopics: error closing text_fh' ); - } - else { - ASSERT( 0, - '_parseBibliographyTopics: error opening text_fh' ); + my @text_array = split(/[\r\n]+/, $text); + foreach my $line (@text_array) { + _parseline($line) } } else {