Projects/i18n-rename

From juliano.info

Jump to: navigation, search

i18n-rename

Last version: 1.0.0
License: GPL
Languages: Bash
Status: Active

i18n-rename is a simple but very useful Bash script that converts the character encoding of the names of a set of files.

Example

Here is an example of a compressed ZIP file with names in ISO8859-1, while my system uses UTF-8 character encoding. i18n-rename is used to convert the filenames as extracted from the ZIP file to UTF-8.

~/Documentos/Cotação% unzip 'Cotação J1013 2008-10-20.zip'
Archive:  Cotação J1013 2008-10-20.zip
  inflating: Cota��o J1013 - Mesas.xls
  inflating: Cota��o J1013 - Arm�rios.xls

~/Documentos/Cotação% ls -l
-rw-r--r-- 1 juliano 251K 2008-10-20 07:32 Cotação J1013 2008-10-20.zip
-rw-rw-r-- 1 juliano 144K 2008-10-19 16:44 Cota��o J1013 - Arm�rios.xls
-rw-rw-r-- 1 juliano 107K 2008-10-19 17:42 Cota��o J1013 - Mesas.xls

~/Documentos/Cotação% i18n-rename -f ISO8859-1 *.xls
`Cota\347\343o J1013 - Arm\341rios.xls' -> `Cotação J1013 - Armários.xls'
`Cota\347\343o J1013 - Mesas.xls' -> `Cotação J1013 - Mesas.xls'

~/Documentos/Cotação% ls -l
-rw-r--r-- 1 juliano 251K 2008-10-20 07:32 Cotação J1013 2008-10-20.zip
-rw-rw-r-- 1 juliano 144K 2008-10-19 16:44 Cotação J1013 - Armários.xls
-rw-rw-r-- 1 juliano 107K 2008-10-19 17:42 Cotação J1013 - Mesas.xls

Download

Views