codeset = nl_langinfo(CODESET);
#endif
if (codeset)
- utf8locale = (ibcmp(codeset, "UTF-8", 5) == 0 ||
- ibcmp(codeset, "UTF8", 4) == 0);
+ utf8locale = (ibcmp(codeset, STR_WITH_LEN("UTF-8")) == 0 ||
+ ibcmp(codeset, STR_WITH_LEN("UTF8") ) == 0);
#if defined(USE_LOCALE)
else { /* nl_langinfo(CODESET) is supposed to correctly
* interpret the locale environment variables,
* but just in case it fails, let's do this manually. */
if (lang)
- utf8locale = (ibcmp(lang, "UTF-8", 5) == 0 ||
- ibcmp(lang, "UTF8", 4) == 0);
+ utf8locale = (ibcmp(lang, STR_WITH_LEN("UTF-8")) == 0 ||
+ ibcmp(lang, STR_WITH_LEN("UTF8") ) == 0);
#ifdef USE_LOCALE_CTYPE
if (curctype)
- utf8locale = (ibcmp(curctype, "UTF-8", 5) == 0 ||
- ibcmp(curctype, "UTF8", 4) == 0);
+ utf8locale = (ibcmp(curctype, STR_WITH_LEN("UTF-8")) == 0 ||
+ ibcmp(curctype, STR_WITH_LEN("UTF8") ) == 0);
#endif
if (lc_all)
- utf8locale = (ibcmp(lc_all, "UTF-8", 5) == 0 ||
- ibcmp(lc_all, "UTF8", 4) == 0);
+ utf8locale = (ibcmp(lc_all, STR_WITH_LEN("UTF-8")) == 0 ||
+ ibcmp(lc_all, STR_WITH_LEN("UTF8") ) == 0);
}
#endif /* USE_LOCALE */
if (utf8locale)
* tell whether HINT_STRICT_REFS is in force or not.
*/
if (!strchr(s,':') && !strchr(s,'\''))
- sv_insert(sv, 0, 0, "main::", 6);
+ sv_insert(sv, 0, 0, STR_WITH_LEN("main::"));
if (i)
(void)rsignal(i, PL_csighandlerp);
else
opts = space - pv;
sv_insert(opts_prog, opts, 0,
- "\\n ", 25);
+ STR_WITH_LEN("\\n "));
}
sv_catpvs(opts_prog,"\\n\",");
* For any scalar type load the handler which is bundled with perl
*/
if (SvTYPE(sv) < SVt_PVAV)
- return PerlIO_find_layer(aTHX_ "scalar", 6, 1);
+ return PerlIO_find_layer(aTHX_ STR_WITH_LEN("scalar"), 1);
/*
* For other types allow if layer is known but don't try and load it
*/
switch (SvTYPE(sv)) {
case SVt_PVAV:
- return PerlIO_find_layer(aTHX_ "Array", 5, 0);
+ return PerlIO_find_layer(aTHX_ STR_WITH_LEN("Array"), 0);
case SVt_PVHV:
- return PerlIO_find_layer(aTHX_ "Hash", 4, 0);
+ return PerlIO_find_layer(aTHX_ STR_WITH_LEN("Hash"), 0);
case SVt_PVCV:
- return PerlIO_find_layer(aTHX_ "Code", 4, 0);
+ return PerlIO_find_layer(aTHX_ STR_WITH_LEN("Code"), 0);
case SVt_PVGV:
- return PerlIO_find_layer(aTHX_ "Glob", 4, 0);
+ return PerlIO_find_layer(aTHX_ STR_WITH_LEN("Glob"), 0);
}
return NULL;
}
Perl_sv_catpvf(aTHX_ name, "[%"IVdf"]", (IV)aindex);
}
else if (subscript_type == FUV_SUBSCRIPT_WITHIN)
- sv_insert(name, 0, 0, "within ", 7);
+ sv_insert(name, 0, 0, STR_WITH_LEN("within "));
return name;
}