Tks Brian,
with the link you provide, I then change the control panel/regional and 
language 
settings/language for non-unicode programs to "chinese (simplified prc)" and 
now 
I can change files with chinese characters.
Thanks




________________________________
From: Brian Fraser <frase...@gmail.com>
To: eventual <eventualde...@yahoo.com>
Sent: Mon, April 25, 2011 11:38:17 AM
Subject: Re: how to rename files that contain chinese characters

On Mon, Apr 25, 2011 at 12:22 AM, eventual <eventualde...@yahoo.com> wrote:

Hi,
>I am using windows operating system.
>I wanted to rename some files within certain directories and my files contain
>chinese characters. After renaming, I could not see those chinese characters,
>what must I do to retain those chinese characters. Below is the file name and
>the script. Thanks
>file name = 141有多少爱可以重来 迪克牛仔.mp3
>after renaming the file is testing123~1.MP3
>
>===== script as follows =========
>#!/usr/bin/perl
>use File::Copy;
>my $directories = 'd:\\test' ;
>opendir (MYHANDLE , $directories) || die "Cant open directories :$! ";
>  my @files = readdir MYHANDLE;
>closedir MYHANDLE;
>foreach (@files) {
>    if (/(^141)(.+$)/){
>       my $original = $_;
>       s/(^141)(.+$)/testing123$2/;
>       rename "$directories\\$original", "$directories\\$_";
>    }
>}
>print @files;

Hey. Unfortunately, besides printing, none of the built-in IO/system operations 
currently work with Unicode. You'll have to do some extra work:

http://www.i-programmer.info/programming/other-languages/1973-unicode-issues-in-perl.html


Brian.

Reply via email to