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 ?
Asked
Active
Viewed 2.6k times
10
-
[This](https://superuser.com/a/762475) is an excellent answer to your question. – Henke Mar 15 '23 at 13:51
2 Answers
11
If you are using Windows try downloading Notepad++. It should recognize the encoding and offers several conversions including UTF-8.
Beaner
- 3,621
- 1
- 20
- 16
-
-
if you need to convert your file: http://www.rishida.net/tools/conversion/ – Adriano Jun 23 '14 at 14:44
9
- 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
SparkAndShine
- 199
- 1
- 6
-
-
1In speaking of converting, use the command `iconv`. For instance, `iconv -f ISO-8859-1 -t UTF-8 filename` – SparkAndShine Jun 02 '15 at 07:03
-
With `file` command, why did both two files encoded with `big5` and `gb2312` present `iso-8859-1`? – niaomingjian Feb 11 '18 at 06:24