#1 case conversion doesn't support cyrillic characters

open
nobody
None
5
2012-07-22
2012-07-22
Anonymous
No

lowercase (and other case conversion utilities) doesn't work for filenames containing cyrillic characters

$ echo :>ПРИВЕТ
$ lowercase ПРИВЕТ
---------- 0 file(s) renamed.

expected

ПРИВЕТ->привет
---------- 1 file(s) renamed.

According to wikipedia (http://en.wikipedia.org/wiki/Tr_%28Unix%29) most tr variants don't support unicode

file-rename-utils-1.7.3
coreutils-8.15-7.fc17.i686

Discussion


  • Anonymous
    2012-07-22

    patch to use sed instead of tr for case conversion

     
  • Steven
    Steven
    2012-07-23

    It appears GNU have no intention of fixing this issue with 'tr' in a hurry.

    I compiled linux binaries for the heirloom 'tr' utility.
    http://sourceforge.net/projects/filerenameutils/files/support/unicode_tr_utility.tgz/download
    which seem to work for me. How do they go ?

    I wouldnt overwrite your system 'tr' though. Just install it somewhere in your path ahead of "which tr",
    or rename it "tr.filerenameutils", and in "lowercase" change the calls to "tr" to "tr.filerenameutils"

     
  • Steven
    Steven
    2012-07-23

    Unicode friendly 'tr' utility

     
  • Steven
    Steven
    2012-07-23

    Hmmm - i initially missed your patch to use 'sed' instead of 'tr'.
    Perhaps it is a better solution.