develooper Front page | perl.perl5.porters | Postings from March 2003

Re: Encode 1.91 / perl 5.8.0 has troubles w/ use encoding and single quotes

From:
Dan Kogai
Date:
March 20, 2003 09:34
Subject:
Re: Encode 1.91 / perl 5.8.0 has troubles w/ use encoding and single quotes
Message ID:
03D2CEA4-5AFA-11D7-AC97-000393AE4244@dan.co.jp
Alexey,

On Friday, Mar 21, 2003, at 00:42 Asia/Tokyo, Alexey Mahotkin wrote:
> Hello,
>
> I believe I've found a rather strange bug:
>
>         use Devel::Peek;
>         use Encode 'is_utf8';
>         use encoding 'koi8-r';
>
>         my $msg = 'some message in koi8-r w/Cyrillic letters';
>         Dump($msg);
>
> Dump($msg) says that the string does not have UTF8 flag set.  If I
> change single quotes to double quotes, all works ok.  Same goes with
> q{} vs qq{}, so I guess it's a Perl problem.

I've run your test script and duplicated the problem.   I have also 
found that the problem seems to be fixed in maintperl and bleedperl.

> I've attached the t/encoding-koi8-r.t test case, which clearly shows
> the problem:

I've attached the modified version of the test script to further 
clarify the problem.

> Sorry if this has already been fixed, I've searched the archives and
> could not find anything there.  If someone could point me to a fix,
> I'd be very grateful.

спасибо|spacibo for the report.

Good news is that this problem has already been fixed in perl 
(5.8.1|5.9.0)-to-be.  Bad news is that the problem lies in the perl 
core so upgrading Encode via CPAN alone will not fix it.

Besides this problem, there have been numerous enhancement applied to 
perl core to make encoding pragma more practical.  I hate to admit this 
but the encoding pragma is rather experimental in Perl 5.8.0.  It's 
only recently that people started exploring and exploiting the feature 
enough for the bugs to emerge....

Dan the Encode Maintainer





nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About