This is an automated email from the git hooks/post-receive script.

gregoa pushed a commit to branch jessie
in repository libencode-perl.

commit 9bf4d66c0e524ca9dbffa266d204b5bf5efe74e3
Author: gregor herrmann <gre...@debian.org>
Date:   Sun Dec 13 16:26:34 2015 +0100

    Add patch dont-die-without-bom.patch.
    
    The decode() routine died when no BOM was found. This patch, backported from
    upstream's 2.77 release, changes the behaviour to fall back to BE
    according to RFC2781 and the Unicode Standard version 8.0.
    
    Closes: #799086
---
 debian/patches/dont-die-without-bom.patch | 56 +++++++++++++++++++++++++++++++
 debian/patches/series                     |  1 +
 2 files changed, 57 insertions(+)

diff --git a/debian/patches/dont-die-without-bom.patch 
b/debian/patches/dont-die-without-bom.patch
new file mode 100644
index 0000000..b1a7994
--- /dev/null
+++ b/debian/patches/dont-die-without-bom.patch
@@ -0,0 +1,56 @@
+From 27682d02f7ac0669043faeb419dd5a104eecfb73 Mon Sep 17 00:00:00 2001
+From: Dan Kogai <dankogai+git...@gmail.com>
+Date: Tue, 15 Sep 2015 22:49:12 +0900
+Subject: [PATCH] Address https://rt.cpan.org/Public/Bug/Display.html?id=107043
+
+  ! Unicode/Unicode.xs Unicode/Unicode.pm
+    Address RT#107043: If no BOM is found, the routine dies.
+    When you decode from UTF-(16|32) without -BE or LE without BOM,
+    Encode now assumes BE accordingly to RFC2781 and the Unicode
+    Standard version 8.0
+
+Bug: https://rt.cpan.org/Public/Bug/Display.html?id=107043
+Bug-Debian: https://bugs.debian.org/799086
+
+--- a/Unicode/Unicode.pm
++++ b/Unicode/Unicode.pm
+@@ -176,7 +176,13 @@
+ 
+ When BE or LE is omitted during decode(), it checks if BOM is at the
+ beginning of the string; if one is found, the endianness is set to
+-what the BOM says.  If no BOM is found, the routine dies.
++what the BOM says.
++
++=item Default Byte Order
++
++When no BOM is found, Encode 2.76 and below croaked.  Since Encode
++2.77 (and 2.63-1+deb8u1), it falls back to BE accordingly to RFC2781 and the 
Unicode
++Standard version 8.0
+ 
+ =item *
+ 
+--- a/Unicode/Unicode.xs
++++ b/Unicode/Unicode.xs
+@@ -164,9 +164,19 @@
+               endian = 'V';
+           }
+           else {
+-              croak("%"SVf":Unrecognised BOM %"UVxf,
+-                    *hv_fetch((HV *)SvRV(obj),"Name",4,0),
+-                    bom);
++               /* No BOM found, use big-endian fallback as specified in
++                * RFC2781 and the Unicode Standard version 8.0:
++                *
++                *  The UTF-16 encoding scheme may or may not begin with
++                *  a BOM. However, when there is no BOM, and in the
++                *  absence of a higher-level protocol, the byte order
++                *  of the UTF-16 encoding scheme is big-endian.
++                *
++                *  If the first two octets of the text is not 0xFE
++                *  followed by 0xFF, and is not 0xFF followed by 0xFE,
++                *  then the text SHOULD be interpreted as big-endian.
++                */
++                s -= size;
+           }
+       }
+ #if 1
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..e26ef97
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+dont-die-without-bom.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-perl/packages/libencode-perl.git

_______________________________________________
Pkg-perl-cvs-commits mailing list
Pkg-perl-cvs-commits@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-perl-cvs-commits

Reply via email to