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

7 comments:

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...

Fantastic!

jack wilson said...
This comment has been removed by a blog administrator.
Sanjana E said...
This comment has been removed by a blog administrator.
rajkumar said...
This comment has been removed by a blog administrator.
kim john said...
This comment has been removed by a blog administrator.