in reply to Re: renaming filenames
in thread renaming filenames

It doesn't work. It only works if the values of $from and $to don't
contain any accents, as in: $from=song and $to=poem but it doesn't work
if they contain accents.

The editor I'm using is vim, so I'm saving my files in utf-8
encoding.

Replies are listed 'Best First'.
Re^3: renaming filenames
by GrandFather (Saint) on Aug 16, 2012 at 05:21 UTC

    The sample script shown worked as expected for me using Windows 7 and Perl 5.10.1 (ActiveState MSWin32-x86-multi-thread build). In what way doesn't it work for you?

    True laziness is hard work

      If I have a file called canción, without any extension, and I want to
      rename it to poesía, without extension, it doesn't do it.
      The file canción remains the same.

      Also if you have a file, say ola.txt, and you want to convert it to
      mas.txt, it won't do it. It only works if the filename has at least 8
      characters including point and extension.
      Moreover, if the $to filename, has equal or more number of characters
      than the $from filename and this has at least 10 characters, strange
      characters appear on the $to filename.

      For example if I want to convert television to publishing I get
      publishing尀⩷␩)ꡀⅦ