Language environment in perl; how to open a file with filename coded in IBM850

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!


any character-set guru out there who can assist me???

I am accessing my Windows-XP-filesystem with samba from my Linux
machine. This works fine as long as there are no Swedish characters in
the filenames but becomes slightly complex (for me at least) when
international characters starts to pop up in the filenames. It seems
like ibm850 encoding is used because doing a "ls" as below works fine:

use encoding "Latin-1";
use open IO  => ":encoding(ibm850)"
open (LS,"ls --show-control-chars /mnt/e|") or die $!;
while ($_=<LS>) {
  print "Fname: /mnt/e/".$_;

When reading the directory as above all filenames are displayed
correctly with international characters. But now to my problem:

How do I open a file. Assume the correct filename is stored in $_:

open (FILE,$_);

....will not work as the filename is encoded in UTF8.

This is probably simple, but I have spent quite some time on this.
Thanks in advance.

/Per Hallkvist

Site Timeline