About the author

My photo

Java, Scala, and everything

Wednesday, December 28, 2011

Easy way to convert file encoding

Easy way to convert text files to UTF-8 on Ubuntu. Install package enca and you are able to:
enconv -L pl -x UTF-8 myfile.txt
Where after -L is language specified (necessary for enca to recognize file encoding before conversion) and after -x destination encoding.
Warning: enconv overwrites existing file, so better create backup copy before.

UPDATE: Another way, useful if you know source file encoding:
iconv -f ISO-8859-2 -t UTF-8 source.txt > utf8.txt


Leszek Gruchała said...

Można też:
iconv -f ISO-8859-2 -t UTF-8 source.txt > output_utf8.txt

pawelstawicki said...

Można jak się zna kodowanie pliku wejściowego. Tym niemniej może się przydać. Dzięki!

Theda said...


jack wilson said...

Your posts is really helpful for me.Thanks for your wonderful post. I am very happy to read your post. It is really very helpful for us and I have gathered some important information from this blog.

JAVA J2EE Training in Chennai

Sanjana E said...

I have read your blog its very attractive and impressive. I like it your blog.
Java Training institute in velachery