A commandline-preciousness for converting filename encoding in Linux: convmv


I want to share a very usefull Linux software I discovered yesterday: convmv. This tool converts filenames from one encoding to another… and it does it well.
I was facing warnings from my Ubuntu filesystem when viewing the contents of a folder I just copied there. The contents of that particular folder were various pictures of various sources. And apparently different filename-encodings were used: Ubuntu complained “(ungültige Kodierung)” (that is german for illegal encoding) on files with german umlauts that originally came from some sort of Windows operating system. I guessed that these filenames were encoded in cp1252.
I wanted to have a tool to do the filename conversion for me, and faintly remembered stumbling on such a software once. Google helped and with a quick

sudo apt-get install convmv

I was ready to check if convmv did the job for my situation. I issued a

convmv -f cp1252 -t utf8 *

in the folder containing the file with illegal encoding and … yes: works like a charm. Actually the above command will only print out a list of conversions that would be done, no actual mv command is executed. If you like what you see, you can actually execute the recoding using:

convmv -f cp1252 -t utf8 --notest *

This a very nice tool and it absolutely saved my day.

Advertisement
Posted in linux. 2 Comments »

2 Responses to “A commandline-preciousness for converting filename encoding in Linux: convmv”

  1. Dicas do comando find « Pasqua Tecnologia Says:

    […] Esse interessante comando do find, apesar de não ser específico para isso, irá listar todos arquivos que estão com erro de encoding no nome. Para mais informações como corrigir o encode do nome do arquivo, acesse: https://selectoid.wordpress.com/2009/07/23/a-commandline-preciousness-for-converting-filename-encodin… […]

  2. Dicas do comando find Says:

    […] Esse interessante comando do find, apesar de não ser específico para isso, irá listar todos arquivos que estão com erro de encoding no nome. Para mais informações como corrigir o encode do nome do arquivo, acesse: https://selectoid.wordpress.com/2009/07/23/a-commandline-preciousness-for-converting-filename-encodin… […]


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: