Google Grup tidak lagi mendukung postingan atau langganan Usenet baru. Konten lama masih dapat dilihat.

Encode::decode_utf8 and references

23 kali dilihat
Langsung ke pesan pertama yang belum dibaca

Sam Tregar

belum dibaca,
17 Jun 2006, 15.34.4617/06/06
kepadaperl-u...@perl.org
Hello all. I'm maintaining a Perl app which relies on a possibly
incorrect behavior in Encode::decode_utf8 - references are expected to
pass through unmangled. This worked fine until a recent upgrade.
Observe Encode v2.08 with Perl v5.6.1:

$ perl -MEncode -MData::Dumper -e \
'my $ref = Encode::decode_utf8({ foo => 1}); print Dumper($ref);'
$VAR1 = {
'foo' => 1
};

However, Encode v2.18 with Perl v5.6.1 is not so forgiving:

$ perl -MEncode -MData::Dumper -e \
'my $ref = Encode::decode_utf8({ foo => 1}); print Dumper($ref);'
$VAR1 = 'HASH(0x9932180)';

So, is this a bug in Encode or a bug in my app? I'm leaning towards
the latter but I thought I'd check with you before I started trying
to fix it (no tests, argh!). Aside from "don't do that", can you
suggest a fix?

Thanks,
-sam

Gisle Aas

belum dibaca,
18 Jun 2006, 07.40.4018/06/06
kepadaSam Tregar, perl-u...@perl.org
Sam Tregar <s...@tregar.com> writes:

> Hello all. I'm maintaining a Perl app which relies on a possibly
> incorrect behavior in Encode::decode_utf8 - references are expected to
> pass through unmangled.

That seems like a very unreasonable expectation to me.

--Gisle

Dan Kogai

belum dibaca,
18 Jun 2006, 23.01.1018/06/06
kepadaSam Tregar, perl-u...@perl.org
Sam,

On Jun 18, 2006, at 04:34 , Sam Tregar wrote:
> Hello all. I'm maintaining a Perl app which relies on a possibly
> incorrect behavior in Encode::decode_utf8 - references are expected to
> pass through unmangled. This worked fine until a recent upgrade.
> Observe Encode v2.08 with Perl v5.6.1:
>
> $ perl -MEncode -MData::Dumper -e \
> 'my $ref = Encode::decode_utf8({ foo => 1}); print Dumper
> ($ref);'
> $VAR1 = {
> 'foo' => 1
> };

I can't help wondering how you got Encode to install.

This is what you'd see when you tried perl Makefile.PL when you tried
to do so.

% ~/perl562/bin/perl Makefile.PL
Perl v5.7.3 required--this is only v5.6.2, stopped at Makefile.PL
line 1.
BEGIN failed--compilation aborted at Makefile.PL line 1.


> However, Encode v2.18 with Perl v5.6.1 is not so forgiving:
>
> $ perl -MEncode -MData::Dumper -e \
> 'my $ref = Encode::decode_utf8({ foo => 1}); print Dumper
> ($ref);'
> $VAR1 = 'HASH(0x9932180)';
>
> So, is this a bug in Encode or a bug in my app? I'm leaning towards
> the latter but I thought I'd check with you before I started trying
> to fix it (no tests, argh!). Aside from "don't do that", can you
> suggest a fix?
>
> Thanks,
> -sam

0th of all, Encode requires Perl 5.8 and above (Perl 5.7.3 to be more
exact but it's a developer version). I have no idea what you use
Encode. All I know is I cannot support your case.

Dan the Maintainer Thereof

Sam Tregar

belum dibaca,
19 Jun 2006, 00.27.0319/06/06
kepadaDan Kogai, perl-u...@perl.org
On Mon, 19 Jun 2006, Dan Kogai wrote:

> I can't help wondering how you got Encode to install.

Sorry - I meant to type 5.8.6. I somehow managed to misread 5.8.6 as
5.6.1. Too many years spent running that fine version, I guess!

> All I know is I cannot support your case.

I can dig it. I'll find a workaround in my app.

-sam

0 pesan baru