Thread File::HomeDir und encoding (7 answers)
Opened by Kuerbis at 2015-01-03 10:38

Kuerbis
 2015-01-03 13:30
#179040 #179040
User since
2011-03-20
943 Artikel
BenutzerIn
[default_avatar]
Wenn ich es mit diesem Skript probiere, funktioniert es mit und ohne decode:

Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!perl 
use warnings;
use strict;
use 5.10.0;

use File::HomeDir;
use Devel::Peek;
use Encode qw( decode );
use Encode::Locale;

binmode STDOUT, ':encoding(console_out)';
binmode STDERR, ':encoding(console_out)';

my $d = File::HomeDir->my_home();
Dump $d;
say $d;

$d = decode( 'locale', $d );
say "================================================";
Dump $d;
say $d;


Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
SV = PVMG(0xc02cbc) at 0xaba78c
REFCNT = 1
FLAGS = (PADMY,POK,pPOK)
IV = 0
NV = 0
PV = 0xc76b4c "C:\\Dokumente und Einstellungen\\h\344ll\366"\0
CUR = 36
LEN = 40
C:\Dokumente und Einstellungen\hällö
================================================
SV = PVMG(0xc02cbc) at 0xaba78c
REFCNT = 1
FLAGS = (PADMY,POK,pPOK,UTF8)
IV = 0
NV = 0
PV = 0xc798b4 "C:\\Dokumente und Einstellungen\\h\303\244ll\303\266"\0 [UTF8 "
C:\\Dokumente und Einstellungen\\h\x{e4}ll\x{f6}"]
CUR = 38
LEN = 40
C:\Dokumente und Einstellungen\hällö

View full thread File::HomeDir und encoding