defined (ignore UTF-8 locales silently if no PerlIO).
p4raw-id: //depot/perl@17180
#endif /* USE_LOCALE */
+#ifdef USE_PERLIO
{
- /* Set PL_wantut8 to TRUE if any of the following are true:
+ /* Set PL_wantut8 to TRUE if using PerlIO _and_
+ any of the following are true:
- nl_langinfo(CODESET) contains /^utf-?8/i
- $ENV{LANGUAGE} contains /^utf-?8/i (only if using glibc)
- $ENV{LC_CALL} contains /^utf-?8/i
if (wantutf8)
PL_wantutf8 = TRUE;
}
+#endif
#ifdef USE_LOCALE_CTYPE
if (curctype != NULL)
If your environment variables (LC_ALL, LC_CTYPE, LANG, LANGUAGE) look
like you want to use UTF-8 (any of the the variables match C</utf-?8/i>),
your STDIN, STDOUT, STDERR handles and the default open discipline
-(see L<open>) are marked as UTF-8.
+(see L<open>) are marked as UTF-8. (This feature, like other new
+features that combine Unicode and I/O, work only if you are using
+PerlIO, but that's is the default.)
Note that after this Perl really does assume that everything is UTF-8:
for example if some input handle is not, Perl will probably very soon
in from another command is not UTF-8, Perl will complain about the
malformed UTF-8.
+All features that combine Unicode and I/O also require using the new
+PerlIO feature. Almost all Perl 5.8 platforms do use PerlIO, though:
+you can see whether yours is by running "perl -V" and looking for
+C<useperlio=define>.
+
=head2 Unicode and EBCDIC
Perl 5.8.0 also supports Unicode on EBCDIC platforms. There,
explicitly opening also the F<file> for input as UTF-8.
B<NOTE>: the C<:utf8> and C<:encoding> features work only if your
-Perl has been built with the new "perlio" feature. Almost all
-Perl 5.8 platforms do use "perlio", though: you can see whether
-yours is by running "perl -V" and looking for C<useperlio=define>.
+Perl has been built with the new PerlIO feature.
=head2 Displaying Unicode As Text