Home arrow Journal arrow Convert a text file from a charset to another charset
Convert a text file from a charset to another charset PDF
Monday, 18 July 2011
Sometimes we have a UTF8 charset file and we want to convert it in other type or viceversa. There's a FreeBSD tool that helps use converting between text file charsets, called iconv:

The following command will convert from ISO-8859-1 to UTF-8 charset:

  iconv -f ISO-8859-1 -t UTF-8 portughese.txt > utf8file.txt

iconv utility is installed with libiconv port. If you don't have iconv installed (which is rare because many other FreeBSD packages/ports will require libiconv library) then you can install libiconv from ports:

  cd /usr/ports/converters/libiconv
  make install clean
  rehash

For more info see iconv man page:

  man iconv

 
< Prev   Next >

Other BSD Systems

OpenBSD

Misc

Solaris

Polls

Best BSD firewall?