views:

195

answers:

3

I have a bunch of text files that are encoded in ISO-8851-2 (have some polish characters). Is there a command line tool for linux/mac that I could run from a shell script to convert this to a saner utf-8?

+3  A: 

GNU 'libiconv' should be able to do the job.

Jonathan Leffler
Thanks! I knew it'd be easier than I thought!
Marcin
A: 
recode latin2..utf8 myfile.txt

This will overwrite myfile.txt with the new version. You can also use recode without a filename as a pipe.

legoscia
+3  A: 

From the command line use

iconv -f LATIN1 -t UTF8

You may want to add //TRANSLIT to UTF8.

lhf