summaryrefslogtreecommitdiff
path: root/lib/open.pm
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2002-03-10 16:00:46 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2002-03-10 16:00:46 +0000
commitba9a69eb5c6ef856a4e5dc1fa901a88f4e13b198 (patch)
treea1294ab4492944a195e545df7ef65859d09de8ae /lib/open.pm
parent5628bcce1bc89f7739f986067312dc27ada319e1 (diff)
downloadperl-ba9a69eb5c6ef856a4e5dc1fa901a88f4e13b198.tar.gz
Document the logic of :locale better.
p4raw-id: //depot/perl@15145
Diffstat (limited to 'lib/open.pm')
-rw-r--r--lib/open.pm25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/open.pm b/lib/open.pm
index e480c130de..3f2d0342c9 100644
--- a/lib/open.pm
+++ b/lib/open.pm
@@ -183,6 +183,31 @@ and these
When open() is given an explicit list of layers they are appended to
the list declared using this pragma.
+The logic of C<:locale> is as follows:
+
+=over 4
+
+=item 1.
+
+If the platform supports the langinfo(CODESET) interface, the codeset
+returned is used as the default encoding for the open pragma.
+
+=item 2.
+
+If 1. didn't work but we are under the locale pragma, the environment
+variables LC_ALL and LANG (in that order) are matched for encodings
+(the part after C<.>, if any), and if any found, that is used
+as the default encoding for the open pragma.
+
+=item 3.
+
+If 1. and 2. didn't work, the environment variables LC_ALL and LANG
+(in that order) are matched for anything looking like UTF-8, and if
+any found, C<:utf8> is used as the default encoding for the open
+pragma.
+
+=back
+
Directory handles may also support disciplines in future.
=head1 NONPERLIO FUNCTIONALITY