More utf8 #162

Open
appomsk opened this Issue Aug 6, 2010 · 1 comment

Comments

Projects
None yet
2 participants

appomsk commented Aug 6, 2010

Ok, I read this in perlunicode:
"One reason why Perl does not attempt to resolve the role of Unicode in these cases is that the answers are highly dependent on the operating system and the file system(s). For example, whether filenames can be in Unicode, and in exactly what kind of encoding, is not exactly a portable concept. Similarly for the qx and system: how well will the 'command line interface' (and which of them?) handle Unicode?

  • chdir, chmod, chown, chroot, exec, link, lstat, mkdir, rename, rmdir, stat, symlink, truncate, unlink, utime, -X
  • %ENV
  • glob (aka the <*>)
  • open, opendir, sysopen
  • qx (aka the backtick operator), system
  • readdir, readlink
    "

But it's not true. On Ubuntu some work but some don't.

use perl5i::2;
use Test::More "no_plan";

$a = "привет";

open my $f, ">", $a;
close $f;

$b = `ls $a`->trim;
is($b, $a);  # ok

$b = glob $a;
is($b, $a);  # not ok

utf8::decode $b;
is($b, $a);  # ok 

unlink $a;

Quick check shows mkdir, chdir, rename, rmdir, unlink, qx, opendir work with utf8, but glob, readdir, %ENV - not.

Is it possible for perl5i use utf8 anywhere?

Contributor

doherty commented Jun 1, 2011

Please feel free to file a bug with https://github.com/doherty/utf8-all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment