From 70dab7dfec8c120925e2bb21858cef56834ae5148e588baab02b447f0220afce Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Tue, 15 Jul 2014 17:20:39 +0000 Subject: [PATCH] Accepting request 241115 from home:mlschroe:branches:Publishing:TeXLive Add biber-decode.diff OBS-URL: https://build.opensuse.org/request/show/241115 OBS-URL: https://build.opensuse.org/package/show/Publishing:TeXLive/texlive?expand=0&rev=176 --- biber-decode.diff | 57 +++++++++++++++++++++++++++++++++++++++++++++++ texlive.changes | 7 ++++++ texlive.spec | 3 +++ 3 files changed, 67 insertions(+) create mode 100644 biber-decode.diff diff --git a/biber-decode.diff b/biber-decode.diff new file mode 100644 index 0000000..a072936 --- /dev/null +++ b/biber-decode.diff @@ -0,0 +1,57 @@ +# perl-5.20.0 contains an Encode::decode_utf8 version that no +# longer short-circuits if the input is already utf8. Instead, +# it dies with a 'Cannot decode string with wide characters' +# error message. +--- ./lib/Biber/Input/file/bibtex.pm.orig 2014-07-15 16:11:39.039227206 +0000 ++++ ./lib/Biber/Input/file/bibtex.pm 2014-07-15 16:15:57.321972318 +0000 +@@ -592,7 +592,8 @@ sub _literal { + # URI fields + sub _uri { + my ($bibentry, $entry, $f) = @_; +- my $value = NFC(decode_utf8($entry->get($f)));# Unicode NFC boundary (before hex encoding) ++ my $value = $entry->get($f); ++ $value = NFC(Encode::is_utf8($value) ? $value : decode_utf8($value)); # Unicode NFC boundary (before hex encoding) + my ($field, $form, $lang) = $f =~ m/$fl_re/xms; + + # If there are some escapes in the URI, unescape them +@@ -600,7 +601,7 @@ sub _uri { + $value =~ s/\\%/%/g; # just in case someone BibTeX escaped the "%" + # This is what uri_unescape() does but it's faster + $value =~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg; +- $value = NFC(decode_utf8($value));# Unicode NFC boundary (before hex encoding) ++ $value = NFC(Encode::is_utf8($value) ? $value : decode_utf8($value)); # Unicode NFC boundary (before hex encoding) + } + + $value = URI->new($value)->as_string; +--- ./lib/Biber/Output/bibtex.pm.orig 2014-07-15 16:14:07.925503890 +0000 ++++ ./lib/Biber/Output/bibtex.pm 2014-07-15 16:18:47.922143172 +0000 +@@ -100,7 +100,8 @@ sub set_output_entry { + next if first {lc($f) eq $_} ('xdata', 'crossref'); + } + # Save post-mapping data for tool mode +- my $value = decode_utf8($be->get_rawfield($f)); ++ my $value = $be->get_rawfield($f); ++ $value = decode_utf8($value) unless Encode::is_utf8($value); + $acc .= ' ' x Biber::Config->getoption('tool_indent'); + $acc .= $casing->($f); + $acc .= ' ' x ($max_field_len - Unicode::GCString->new($f)->length) if Biber::Config->getoption('tool_align'); +--- ./lib/Biber/Utils.pm.orig 2014-07-15 16:12:11.829067919 +0000 ++++ ./lib/Biber/Utils.pm 2014-07-15 16:17:57.874386675 +0000 +@@ -147,7 +147,7 @@ sub locate_biber_file { + chomp $found; + $found =~ s/\cM\z//xms; # kpsewhich in cygwin sometimes returns ^M at the end + # filename can be UTF-8 and run3() isn't clever with UTF-8 +- return decode_utf8($found); ++ return Encode::is_utf8($found) ? $found : decode_utf8($found); + } + else { + $logger->debug("Could not find '$filename' via kpsewhich"); +@@ -935,7 +935,7 @@ sub parse_date { + =cut + + sub biber_decode_utf8 { +- return NFD(decode_utf8(shift));# Unicode NFD boundary ++ return NFD(Encode::is_utf8($_[0]) ? $_[0] : decode_utf8($_[0]));# Unicode NFD boundary + } + + =head2 out diff --git a/texlive.changes b/texlive.changes index 1c7efaf..a28f6de 100644 --- a/texlive.changes +++ b/texlive.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Jul 15 18:24:30 CEST 2014 - mls@suse.de + +- Add biber-decode.diff: Fix build with perl-5.20.0, where + Encode::decode_utf8 no longer short-circuits if the input + is already utf8. + ------------------------------------------------------------------- Tue May 20 09:23:14 UTC 2014 - schwab@suse.de diff --git a/texlive.spec b/texlive.spec index 7cb2af2..ecef088 100644 --- a/texlive.spec +++ b/texlive.spec @@ -233,6 +233,8 @@ Patch42: biblatex-encoding.dif Patch43: biber-av.patch # PATCH-FIX-UPSTREAM deal with semantic change of Perl Readonly implementation in version 1.04 Patch44: biber-noreadonly.diff +# PATCH-FIX-UPSTREAM deal with semantic change of Perl's Encode::decode_utf8 in perl-5.20.0 +Patch45: biber-decode.diff Prefix: %{_bindir} %{expand: %%global options %(mktemp /tmp/texlive-opts.XXXXXXXX)} @@ -2295,6 +2297,7 @@ pushd ../biblatex-biber-* %patch42 -p0 -b .en %patch43 -p1 -b .av %patch44 -p1 -b .ro +%patch45 -p1 -b .decode popd %endif