summaryrefslogtreecommitdiff
path: root/mg.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2003-01-16 01:58:39 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2003-01-16 01:58:39 +0000
commitfde18df140d5f64815bdd632a127ecd5ce3d97fa (patch)
tree80f64f24787f44508939d3f4b0912ac97d9cf9dc /mg.c
parentcd2d1bacbf7960cece81f64bfbaaedda360c78aa (diff)
downloadperl-fde18df140d5f64815bdd632a127ecd5ce3d97fa.tar.gz
Make the locale-induced UTF-8-ification of STD fhs
and the default file open layer explicit (either -C or PERL_UTF8_LOCALE), instead of implicit (and unasked-for). p4raw-id: //depot/perl@18490
Diffstat (limited to 'mg.c')
-rw-r--r--mg.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/mg.c b/mg.c
index bdf204bd8f..72c8fdfcd8 100644
--- a/mg.c
+++ b/mg.c
@@ -662,7 +662,11 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg)
? (PL_taint_warn || PL_unsafe ? -1 : 1)
: 0);
break;
- case '\027': /* ^W & $^WARNING_BITS & ^WIDE_SYSTEM_CALLS */
+ case '\025': /* $^UTF8_LOCALE */
+ if (strEQ(mg->mg_ptr, "\025TF8_LOCALE"))
+ sv_setiv(sv, (IV) (PL_wantutf8 && PL_utf8locale));
+ break;
+ case '\027': /* ^W & $^WARNING_BITS */
if (*(mg->mg_ptr+1) == '\0')
sv_setiv(sv, (IV)((PL_dowarn & G_WARN_ON) ? TRUE : FALSE));
else if (strEQ(mg->mg_ptr+1, "ARNING_BITS")) {
@@ -679,8 +683,6 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg)
}
SvPOK_only(sv);
}
- else if (strEQ(mg->mg_ptr+1, "IDE_SYSTEM_CALLS"))
- sv_setiv(sv, (IV)PL_widesyscalls);
break;
case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9': case '&':
@@ -1925,7 +1927,13 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg)
PL_basetime = (Time_t)(SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv));
#endif
break;
- case '\027': /* ^W & $^WARNING_BITS & ^WIDE_SYSTEM_CALLS */
+ case '\025': /* $^UTF8_LOCALE */
+ if (SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv))
+ PL_wantutf8 = PL_utf8locale;
+ else
+ PL_wantutf8 = FALSE;
+ break;
+ case '\027': /* ^W & $^WARNING_BITS */
if (*(mg->mg_ptr+1) == '\0') {
if ( ! (PL_dowarn & G_WARN_ALL_MASK)) {
i = SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv);
@@ -1967,8 +1975,6 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg)
}
}
}
- else if (strEQ(mg->mg_ptr+1, "IDE_SYSTEM_CALLS"))
- PL_widesyscalls = (bool)SvTRUE(sv);
break;
case '.':
if (PL_localizing) {