summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2002-04-07 14:51:04 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2002-04-07 14:51:04 +0000
commit735b7a62d039909fa334af8e05d4788f54c2c65a (patch)
treeedbd2278cd43fa1471d1812ebf8b864fdd90a908
parent9b3032b7d9e3c8e820c1ad71015731661bd6d109 (diff)
downloadperl-735b7a62d039909fa334af8e05d4788f54c2c65a.tar.gz
Duh. If the input is a stream of UTF-8 bytes, all that's
needed is SvUTF8_on(), sv_utf8_upgrade() is quite bogus. Now, where was my coffee mug... p4raw-id: //depot/perl@15779
-rw-r--r--ext/File/Glob/Glob.pm1
-rw-r--r--ext/File/Glob/Glob.xs4
-rw-r--r--pod/perlfunc.pod1
-rw-r--r--pp_sys.c4
4 files changed, 4 insertions, 6 deletions
diff --git a/ext/File/Glob/Glob.pm b/ext/File/Glob/Glob.pm
index 4c34d380b0..1ae894f048 100644
--- a/ext/File/Glob/Glob.pm
+++ b/ext/File/Glob/Glob.pm
@@ -338,7 +338,6 @@ Unicode compatibility:
The filenames returned will be marked as being in UTF-8 encoding of
Unicode. Note that it is your responsibility to ascertain that the
filesystem you are globbing in returns valid UTF-8 filenames.
-The encoding pragma affects this feature, see L<encoding>.
=head1 DIAGNOSTICS
diff --git a/ext/File/Glob/Glob.xs b/ext/File/Glob/Glob.xs
index 5d95666137..1bb5fc4392 100644
--- a/ext/File/Glob/Glob.xs
+++ b/ext/File/Glob/Glob.xs
@@ -63,8 +63,8 @@ PPCODE:
strlen(pglob.gl_pathv[i])));
TAINT;
SvTAINT(tmp);
- if (pglob.gl_flags & GLOB_UTF8)
- sv_utf8_upgrade(tmp);
+ if (pglob.gl_flags & GLOB_UTF8 && !IN_BYTES)
+ SvUTF8_on(tmp);
PUSHs(tmp);
}
diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod
index c04cc482c8..048ecfb4ba 100644
--- a/pod/perlfunc.pod
+++ b/pod/perlfunc.pod
@@ -3035,7 +3035,6 @@ DIRHANDLEs have their own namespace separate from FILEHANDLEs.
In three-argument form the middle argument may be C<:utf8> to force
the filenames returned by readdir() to be in UTF-8 encoding of Unicode.
This naturally works only if your filesystem returns UTF-8 filenames.
-The encoding pragma affects this feature, see L<encoding>.
=item ord EXPR
diff --git a/pp_sys.c b/pp_sys.c
index ea9a6a53b8..aa8fb77acc 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -3817,8 +3817,8 @@ PP(pp_readdir)
if (!(IoFLAGS(io) & IOf_UNTAINT))
SvTAINTED_on(sv);
#endif
- if (IoFLAGS(io) & IOf_DIR_UTF8)
- sv_utf8_upgrade(sv);
+ if (IoFLAGS(io) & IOf_DIR_UTF8 && !IN_BYTES)
+ SvUTF8_on(sv);
XPUSHs(sv_2mortal(sv));
}
}