On 2013-04-07 16:42:59, vsespb wrote:
Show quoted text> perl -MEncode -e 'print Encode->VERSION'
> 2.42_01
>
>
> The following commands hang with 50% CPU on
> FreeBSD 9.1 (This is perl 5, version 14, subversion 2 (v5.14.2) built
> for amd64-freebsd
> )
>
> perl -MEncode -MCarp -e 'binmode STDERR, ":encoding(koi8-r)"; confess
> encode("utf-8",
> "\x{410}\x{432}\x{442}\x{43e}\x{43f}\x{430}\x{440}\x{43a}")'
>
> perl -MEncode -MCarp -e 'binmode STDERR, ":encoding(koi8-r)"; confess
> encode("utf-8", "\x{410}\x{432}\x{442}\x{43e}\x{43f}\x{430}\x{440}")'
>
>
> and the following work fine:
>
> perl -MEncode -MCarp -e 'binmode STDERR, ":encoding(koi8-r)"; confess
> encode("utf-8", "\x{410}\x{432}\x{442}\x{43e}\x{43f}\x{430}")'
>
> perl -MEncode -MCarp -e 'binmode STDERR, ":encoding(koi8-r)"; confess
> encode("utf-8", "\x{440}\x{43a}")'
>
>
> $ locale
> LANG=
> LC_CTYPE="C"
> LC_COLLATE="C"
> LC_TIME="C"
> LC_NUMERIC="C"
> LC_MONETARY="C"
> LC_MESSAGES="C"
> LC_ALL=
>
> also, cannot reproduce under linux
>
> possibly related to #84282
I have a similar problem (see attached script), but I can reproduce it on a Linux system (Mint 18). Don't make the filename of the test script shorter; this makes the warning message shorter and may not exhibit the problem anymore (or put some more X's into the test string).
It does not seem to be related to a particular perl version (I see the problem with 5.12.3 and 5.28.0), but a bisect in Encode shows that the problem started with this commit
31d16654f4cb56f88dc7a01ee1897f4ec8318c1a is the first bad commit
commit 31d16654f4cb56f88dc7a01ee1897f4ec8318c1a
Author: dankogai <dankogai@d0d07461-0603-4401-acd4-de1884942a52>
Date: Fri Dec 31 22:59:40 2010 +0000
VERSION 2.42
Trying the
$PerlIO::encoding::fallback = Encode::FB_QUIET;
workaround did not work for me. What did work is to replace utf-8 by utf8.
Probably a fix is hard, but it would be nice if there was a paragraph about this problem (and the possible workaround using "utf8") in the BUGS or CAVEATS section of encoding.pod.