develooper Front page | perl.perl5.porters | Postings from June 2013

[perl #118709] File::Find strips utf8 property off found strings

Thread Next
From:
Karen Etheridge
Date:
June 30, 2013 22:53
Subject:
[perl #118709] File::Find strips utf8 property off found strings
Message ID:
rt-3.6.HEAD-2552-1372632772-583.118709-75-0@perl.org
# New Ticket Created by  Karen Etheridge 
# Please include the string:  [perl #118709]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=118709 >



This is a bug report for perl from ether@cpan.org,
generated with the help of perlbug 1.39 running under perl 5.19.1.


-----------------------------------------------------------------


Strings returned by File::Find have lost their utf8 property, even when they
are still printable.

Below is a simple repro case:

    use strict;
    use warnings;
    use utf8;

    open my $fh, '>', 'ಠ_ಠ.pm' or die $!;
    print $fh "\n";
    close $fh;

    use File::Find;
    find(
      sub {
        return if $File::Find::name !~ /\.pm\z/;
        my $found = $File::Find::name;
        print "### $found is utf8? ", (utf8::is_utf8($found) ? 1 : 0), "\n";
      },
      '.',
    );


[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
    category=library
    severity=low
    module=File::Find
---
Site configuration information for perl 5.19.1:

Configured by ether at Fri Jun 21 09:39:23 PDT 2013.

Summary of my perl5 (revision 5 version 19 subversion 1) configuration:
   
  Platform:
    osname=darwin, osvers=10.8.0, archname=darwin-2level
    uname='darwin tequila 10.8.0 darwin kernel version 10.8.0: tue jun 7 16:33:36 pdt 2011; root:xnu-1504.15.3~1release_i386 i386 '
    config_args='-de -Dprefix=/Users/ether/perl5/perlbrew/perls/19.1 -Dman1dir=none -Dman3dir=none -Dusedevel -Aeval:scriptdir=/Users/ether/perl5/perlbrew/perls/19.1/bin'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=undef, usemultiplicity=undef
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=define, use64bitall=define, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -I/opt/local/include',
    optimize='-O3',
    cppflags='-fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -I/opt/local/include'
    ccversion='', gccversion='4.2.1 (Apple Inc. build 5666) (dot 3)', gccosandvers=''
    intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='env MACOSX_DEPLOYMENT_TARGET=10.3 cc', ldflags =' -fstack-protector -L/usr/local/lib -L/opt/local/lib'
    libpth=/usr/local/lib /opt/local/lib /usr/lib
    libs=-lgdbm -ldbm -ldl -lm -lutil -lc
    perllibs=-ldl -lm -lutil -lc
    libc=, so=dylib, useshrplib=false, libperl=libperl.a
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ', lddlflags=' -bundle -undefined dynamic_lookup -L/usr/local/lib -L/opt/local/lib -fstack-protector'

Locally applied patches:
    

---
@INC for perl 5.19.1:
    /Users/ether/.perlbrew/libs/19.1@std/lib/perl5/darwin-2level
    /Users/ether/.perlbrew/libs/19.1@std/lib/perl5
    /Users/ether/perl5/perlbrew/perls/19.1/lib/site_perl/5.19.1/darwin-2level
    /Users/ether/perl5/perlbrew/perls/19.1/lib/site_perl/5.19.1
    /Users/ether/perl5/perlbrew/perls/19.1/lib/5.19.1/darwin-2level
    /Users/ether/perl5/perlbrew/perls/19.1/lib/5.19.1
    .

---
Environment for perl 5.19.1:
    DYLD_LIBRARY_PATH (unset)
    HOME=/Users/ether
    LANG=en_US
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/Users/ether/bin:/Users/ether/.perlbrew/libs/19.1@std/bin:/Users/ether/perl5/perlbrew/bin:/Users/ether/perl5/perlbrew/perls/19.1/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
    PERL5LIB=/Users/ether/.perlbrew/libs/19.1@std/lib/perl5
    PERLBREW_BASHRC_VERSION=0.64
    PERLBREW_HOME=/Users/ether/.perlbrew
    PERLBREW_LIB=std
    PERLBREW_MANPATH=/Users/ether/.perlbrew/libs/19.1@std/man:/Users/ether/perl5/perlbrew/perls/19.1/man
    PERLBREW_PATH=/Users/ether/.perlbrew/libs/19.1@std/bin:/Users/ether/perl5/perlbrew/bin:/Users/ether/perl5/perlbrew/perls/19.1/bin
    PERLBREW_PERL=19.1
    PERLBREW_ROOT=/Users/ether/perl5/perlbrew
    PERLBREW_VERSION=0.64
    PERLDOC_PAGER=less -sicMr
    PERL_AUTOINSTALL_PREFER_CPAN=1
    PERL_BADLANG (unset)
    PERL_LOCAL_LIB_ROOT=/Users/ether/.perlbrew/libs/19.1@std
    PERL_MB_OPT=--install_base /Users/ether/.perlbrew/libs/19.1@std
    PERL_MM_OPT=INSTALL_BASE=/Users/ether/.perlbrew/libs/19.1@std
    SHELL=/bin/bash

-- 
             "Knowledge speaks but wisdom listens." - Jimi Hendrix
            .             .            .            .             .
Karen Etheridge, karen@etheridge.ca       GCS C+++$ USL+++$ P+++$ w--- M++


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About