Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARGV gehts encoded multiple times when perl5i is used multiple times #176

Closed
datamuc opened this issue Jan 28, 2011 · 2 comments
Closed

Comments

@datamuc
Copy link

datamuc commented Jan 28, 2011

Example code (refered as foo.pl):

{
    package Foo;
    use perl5i::2;
}
{
    package Bar;
    use perl5i::2;
}
use Devel::Peek;
Dump($ARGV[0]);

If you run that with perl foo.pl ö, it prints the following:

SV = PV(0x8f917c8) at 0x8facf80
  REFCNT = 1
  FLAGS = (POK,pPOK,UTF8)
  PV = 0x93dbe58 "\357\277\275"\0 [UTF8 "\x{fffd}"]
  CUR = 3
  LEN = 4

But it should print:

SV = PV(0x96077c8) at 0x9622f80
  REFCNT = 1
  FLAGS = (POK,pPOK,UTF8)
  PV = 0x9adbfa8 "\303\266"\0 [UTF8 "\x{f6}"]
  CUR = 2
  LEN = 4

I guess this get's executed twice (from perl5i/2.pm):

# utf8ify @ARGV
$_ = Encode::decode('utf8', $_) for @ARGV;
@schwern
Copy link
Contributor

schwern commented Jan 29, 2011

Yep, that really should only happen once per load. Just needs a state flag.

@schwern
Copy link
Contributor

schwern commented Feb 15, 2011

Only encode @argv once.

Closed by 022b4cc

dap pushed a commit to dap/perl5i that referenced this issue Sep 6, 2011
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants