Home arrow Journal arrow Find the charset of a file in FreeBSD
Find the charset of a file in FreeBSD PDF
Monday, 18 July 2011
If you want to know/find the charset of a text file there's a nice tool in freebsd call file.

For example I have a text file and I want it to import in a MySQL database and I want to know how charset to use for that database, it would be usefull to know the charset of my text file.

To find the charset we use FreeBSD's file command (for a French file):

  file -i french.txt
french.txt: text/plain; charset=iso-8859-1

or (for a Portugheze text file):

  file -i port.txt
  port.txt: text/plain; charset=iso-8859-1

or (for an English text file):

  file -i eng.txt
  eng.txt: text/plain; charset=us-ascii

 
< Prev   Next >

Other BSD Systems

OpenBSD

Misc

Solaris

Polls

Best BSD firewall?