Is the a tool (mac or online) that can help me to find out the character set of a text file, and then convert it to utf-8 ?
2 Answers
If you are using Windows try downloading Notepad++. It should recognize the encoding and offers several conversions including UTF-8.
- Nice tool, thank you!! (my score is 11 so I can't boost your).ragnarius– ragnarius2010-03-24 20:31:45 +00:00Commented Mar 24, 2010 at 20:31
- if you need to convert your file: rishida.net/tools/conversionAdri w Ukraine– Adri w Ukraine2014-06-23 14:44:57 +00:00Commented Jun 23, 2014 at 14:44
- for linux, use
file -i filename - for mac, use
file -I filename
For instance,
$ file -i readme.txt readme.txt: text/plain; charset=iso-8859-1 BTW, for converting, use iconv, for instance,
iconv -f ISO-8859-1 -t UTF-8 filename - Thanks, but it does not convertragnarius– ragnarius2015-06-01 21:15:50 +00:00Commented Jun 1, 2015 at 21:15
- 1In speaking of converting, use the command
iconv. For instance,iconv -f ISO-8859-1 -t UTF-8 filenameSparkAndShine– SparkAndShine2015-06-02 07:03:59 +00:00Commented Jun 2, 2015 at 7:03 - With
filecommand, why did both two files encoded withbig5andgb2312presentiso-8859-1?niaomingjian– niaomingjian2018-02-11 06:24:07 +00:00Commented Feb 11, 2018 at 6:24 - This answer is incorrect.
file -i filenamewill fail to detect the charset on some files, which have mostly characters from one set, but some from another.einpoklum– einpoklum2024-08-28 22:00:24 +00:00Commented Aug 28, 2024 at 22:00