Subject: | Module Encode doesn't work with Par-Packer |
Date: | Sat, 28 Jan 2012 22:46:24 +0100 |
To: | bug-Encode [...] rt.cpan.org |
From: | Gilles Peyroux <gilles.peyroux [...] gmail.com> |
Consider this simple script:
require Encode;
print Encode::find_encoding('utf16-le');
It works as intended and displays a hashref. But when compiling this
program with the command:
pp -vvv -z 9 -o test.exe test.pl
... and launching test.exe, it displays nothing. When turning DEBUG
on, it seems the problem lies between Encode::find_encoding and
Encode::Alias::find_alias because output is different between both
versions.
Output of test.pl:
delete $Alias{C} at C:/perl/CitrusPerl/x86/5-14/lib/Encode/Alias.pm line 100.
delete $Alias{ascii} at
C:/perl/CitrusPerl/x86/5-14/lib/Encode/Alias.pm line 100.
delete $Alias{cyrillic} at
C:/perl/CitrusPerl/x86/5-14/lib/Encode/Alias.pm line 100.
delete $Alias{arabic} at
C:/perl/CitrusPerl/x86/5-14/lib/Encode/Alias.pm line 100.
delete $Alias{greek} at
C:/perl/CitrusPerl/x86/5-14/lib/Encode/Alias.pm line 100.
delete $Alias{hebrew} at
C:/perl/CitrusPerl/x86/5-14/lib/Encode/Alias.pm line 100.
delete $Alias{thai} at C:/perl/CitrusPerl/x86/5-14/lib/Encode/Alias.pm line 100.
Encode::utf8 XS on at C:/perl/CitrusPerl/x86/5-14/lib/Encode.pm line 297.
eval "UTF-$1LE" at C:/perl/CitrusPerl/x86/5-14/lib/Encode/Alias.pm line 32.
(?^i:^UTF-?(16|32)-?LE$), UTF-16LE at
C:/perl/CitrusPerl/x86/5-14/lib/Encode/Alias.pm line 45.
eval "UTF-$1LE" at C:/perl/CitrusPerl/x86/5-14/lib/Encode/Alias.pm line 32.
eval "\L$1" at C:/perl/CitrusPerl/x86/5-14/lib/Encode/Alias.pm line 32.
(?^:^(.*)$), utf-16le at
C:/perl/CitrusPerl/x86/5-14/lib/Encode/Alias.pm line 45.
eval "UTF-$1LE" at C:/perl/CitrusPerl/x86/5-14/lib/Encode/Alias.pm line 32.
(?^i:^UTF-?(16|32)-?LE$), UTF-16LE at
C:/perl/CitrusPerl/x86/5-14/lib/Encode/Alias.pm line 45.
find_alias(Encode, UTF-16LE)->name = at
C:/perl/CitrusPerl/x86/5-14/lib/Encode/Alias.pm line 75.
find_alias(Encode, utf-16le)->name = at
C:/perl/CitrusPerl/x86/5-14/lib/Encode/Alias.pm line 75.
find_alias(Encode, utf-16le)->name = UTF-16LE at
C:/perl/CitrusPerl/x86/5-14/lib/Encode/Alias.pm line 75.
find_alias(Encode, UTF-16LE)->name = UTF-16LE at
C:/perl/CitrusPerl/x86/5-14/lib/Encode/Alias.pm line 75.
find_alias(Encode, utf16-le)->name = UTF-16LE at
C:/perl/CitrusPerl/x86/5-14/lib/Encode/Alias.pm line 75.
Output of test.exe:
delete $Alias{C} at Encode/Alias.pm line 100.
delete $Alias{ascii} at Encode/Alias.pm line 100.
delete $Alias{cyrillic} at Encode/Alias.pm line 100.
delete $Alias{arabic} at Encode/Alias.pm line 100.
delete $Alias{greek} at Encode/Alias.pm line 100.
delete $Alias{hebrew} at Encode/Alias.pm line 100.
delete $Alias{thai} at Encode/Alias.pm line 100.
Encode::utf8 XS on at Encode.pm line 297.
eval "UTF-$1LE" at Encode/Alias.pm line 32.
(?^i:^UTF-?(16|32)-?LE$), UTF-16LE at Encode/Alias.pm line 45.
eval "UTF-$1LE" at Encode/Alias.pm line 32.
eval "\L$1" at Encode/Alias.pm line 32.
(?^:^(.*)$), utf-16le at Encode/Alias.pm line 45.
eval "UTF-$1LE" at Encode/Alias.pm line 32.
(?^i:^UTF-?(16|32)-?LE$), UTF-16LE at Encode/Alias.pm line 45.
find_alias(Encode, UTF-16LE)->name = at Encode/Alias.pm line 75.
find_alias(Encode, utf-16le)->name = at Encode/Alias.pm line 75.
eval "\L$1" at Encode/Alias.pm line 32.
find_alias(Encode, UTF-16LE)->name = at Encode/Alias.pm line 75.
find_alias(Encode, utf-16le)->name = at Encode/Alias.pm line 75.
utf-16le => UTF-16LE at Encode/Alias.pm line 63.
find_alias(Encode, utf-16le)->name = at Encode/Alias.pm line 75.
find_alias(Encode, UTF-16LE)->name = at Encode/Alias.pm line 75.
find_alias(Encode, utf-16le)->name = at Encode/Alias.pm line 75.
UTF-16LE => UTF-16LE at Encode/Alias.pm line 63.
find_alias(Encode, UTF-16LE)->name = at Encode/Alias.pm line 75.
find_alias(Encode, utf-16le)->name = at Encode/Alias.pm line 75.
eval "\L$1" at Encode/Alias.pm line 32.
find_alias(Encode, utf16-le)->name = at Encode/Alias.pm line 75.
As you can see, find_alias is unable to find the encoding once the
script is packed. I don't really understand the algorithm in those
subs. I don't know what's going on here.
Why this discrepancy?
PS: this is only a script to reproduce the bug. The larger problem is
that it breaks other modules when compiling, for example
Win32::Unicode.
Regards,
Gilles.