mike.scharnow has asked for the wisdom of the Perl Monks concerning the following question:
I'm stuck here and could not find any good search keywords to answer my question. So, sorry if this is already answered elsewhere.
I'm working on a SLES Linux with UTF-8 support switched on. Given is a file which contains german umlauts in its name (e.g. 'Fehler für Projekt x.xls') The following code worked perfectly on an older SLES:
On this machine, it is possible to useunless (opendir(DIR,$scandir)) { confess "can't open the directory $scandir: $@"; } @files=grep {-f "$scandir/$_"} readdir(DIR);
but as soon as I concatenate the retrieved filename with some other string, e.g. "$scandir/$_" or $scandir."/".$_ or $scandir."/".$files[0], "-f" does not work any more plus I cannot copy or move $scandir."/".$files[0]. Is there any general setting that I have to do in my perl code to treat utf files correctly? I already tried "use utf8;" or 'use encoding "utf8";' but these did not make a difference.chdir ($scandir); opendir(DIR,'.'); @files=grep {-f $_} readdir(DIR);
Thanks for your help
Mike
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: treat files with umlauts (utf)
by Anonymous Monk on Apr 01, 2014 at 07:01 UTC | |
|
Re: treat files with umlauts (utf)
by zentara (Cardinal) on Apr 01, 2014 at 08:59 UTC | |
by GotToBTru (Prior) on Apr 07, 2014 at 16:42 UTC | |
by zentara (Cardinal) on Apr 08, 2014 at 17:59 UTC | |
|
Re: treat files with umlauts (utf)
by kcott (Archbishop) on Apr 01, 2014 at 10:50 UTC | |
by hazylife (Monk) on Apr 01, 2014 at 11:08 UTC | |
by kcott (Archbishop) on Apr 01, 2014 at 11:56 UTC | |
by hazylife (Monk) on Apr 01, 2014 at 12:54 UTC | |
by kcott (Archbishop) on Apr 01, 2014 at 13:25 UTC | |
|