How to find out the character set of a text file
21,929
Solution 1
If you are using Windows try downloading Notepad++. It should recognize the encoding and offers several conversions including UTF-8.
Solution 2
- 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
Related videos on Youtube
Author by
ragnarius
Updated on September 17, 2022Comments
-
ragnarius almost 2 years
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 ?
-
ragnarius over 14 yearsNice tool, thank you!! (my score is 11 so I can't boost your).
-
Adrien Be about 10 yearsif you need to convert your file: rishida.net/tools/conversion
-
ragnarius about 9 yearsThanks, but it does not convert
-
SparkAndShine about 9 yearsIn speaking of converting, use the command
iconv
. For instance,iconv -f ISO-8859-1 -t UTF-8 filename
-
niaomingjian over 6 yearsWith
file
command, why did both two files encoded withbig5
andgb2312
presentiso-8859-1
?