Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File names with german (or utf) characters

Status
Not open for further replies.

vcsppl

Programmer
Joined
Jul 19, 2007
Messages
2
Location
US
I was trying to copy to a file with the name having a german character and it fails. Here is the sample script

use strict;
use IO::File;
use File::Copy;
my $output = IO::File->new("> C:/temp/op.txt");
my $input = IO::File->new("< C:/temp/ip.txt") or die "could not open file for input\n";
my $ln = $ip->getline();
chomp($ln);
print $op "$ln\n";
$op->close;
$ip->close;
copy("C:\\temp\\abc.exe",$ln);

The input file have character "ü" and if the input file is saved in utf-8 (using notepad), it writes into the outfile proper charecter in utf-8, but the file copied with other characters. How can i force file copy to use utf-8 character. I was using xp both in german or xp.
 
Sorry, I posted in a hurry. Just to clarify, when I ran the above script a file was created with different name, seems to me that each 8 bit character was used to instead of the multibyte character (ü).

I was rally under pressure and I am relatively new to perl even though i was writing few scripts earlier. Thanks for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top