in reply to How to copy files with Chinese names and special characters in Suse Linux?

use File::Copy; copy("$spath$1/$2/$3", "$tpath$3");

In general, for running shell commands with whitespace in the arguments, use the LIST form of system (described in the docs).

  • Comment on Re: How to copy files with Chinese names and special characters in Suse Linux?
  • Download Code

Replies are listed 'Best First'.
Re^2: How to copy files with Chinese names and special characters in Suse Linux?
by anne3294 (Initiate) on Jun 20, 2011 at 08:19 UTC
    Thanks for answering this question. But, that doesn't work, and the message is that "there is no such directory or file" when there is whitespace in file name. Does anyone has any other ideas ? Thanks for help in advance! - Anne
      Do the files and directories actually exist on your system?

      Try removing the use utf8;, since path names are byte strings on Linux and Unix systems.

        If you did as moritz suggestions, and assure the files or directories exist, I suspect filecoding setting of file you edit may be incorrect. please check:
        • input env in terminal to see what NLS_LANG is.
        • check filecodings, the easiest way is to open file by a browser, and see which coding can show chinese words correctly.
        • try using utf8::all instead utf8 if file coding is utf8
        Hi, Thanks for trying answering ! I think the trouble is that Perl can not recognize those file names with space and special marks such as [.-( {... as for Chinese name, put "use UTF8;" in front of program is ok, but it doesn't help for those special marks and space in file name. Our Perl version is 5.8.3; does this matter ? -- Anne