summaryrefslogtreecommitdiff
path: root/perl.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-02-29 18:11:34 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-02-29 18:11:34 +0000
commit729a02f2394e6a50fe8352c9471391b53e54ac40 (patch)
tree2a6312b320ed2281bb204f6b7de63b23d0b66ca7 /perl.c
parent4d6cd4d833a6068f248475b5c22081cd80bd7a5e (diff)
downloadperl-729a02f2394e6a50fe8352c9471391b53e54ac40.tar.gz
utf8-ize @ARGV when -C switch is used on Windows
p4raw-id: //depot/perl@5364
Diffstat (limited to 'perl.c')
-rw-r--r--perl.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/perl.c b/perl.c
index cba035f83a..ef6a8bdbf2 100644
--- a/perl.c
+++ b/perl.c
@@ -906,12 +906,16 @@ S_parse_body(pTHX_ char **env, XSINIT_t xsinit)
s = argv[0]+1;
reswitch:
switch (*s) {
+ case 'C':
+#ifdef WIN32
+ win32_argv2utf8(aTHX_ argc-1, argv+1);
+ /* FALL THROUGH */
+#endif
#ifndef PERL_STRICT_CR
case '\r':
#endif
case ' ':
case '0':
- case 'C':
case 'F':
case 'a':
case 'c':
@@ -3153,7 +3157,10 @@ S_init_postdump_symbols(pTHX_ register int argc, register char **argv, register
(void)gv_AVadd(PL_argvgv);
av_clear(GvAVn(PL_argvgv));
for (; argc > 0; argc--,argv++) {
- av_push(GvAVn(PL_argvgv),newSVpv(argv[0],0));
+ SV *sv = newSVpv(argv[0],0);
+ av_push(GvAVn(PL_argvgv),sv);
+ if (PL_widesyscalls)
+ sv_utf8_upgrade(sv);
}
}
if (PL_envgv = gv_fetchpv("ENV",TRUE, SVt_PVHV)) {