11

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 ?

1
  • This is an excellent answer to your question. Commented Mar 15, 2023 at 13:51

2 Answers 2

11

If you are using Windows try downloading Notepad++. It should recognize the encoding and offers several conversions including UTF-8.

2
  • Nice tool, thank you!! (my score is 11 so I can't boost your). Commented Mar 24, 2010 at 20:31
  • if you need to convert your file: rishida.net/tools/conversion Commented Jun 23, 2014 at 14:44
8
  • 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 
4
  • Thanks, but it does not convert Commented Jun 1, 2015 at 21:15
  • 1
    In speaking of converting, use the command iconv. For instance, iconv -f ISO-8859-1 -t UTF-8 filename Commented Jun 2, 2015 at 7:03
  • With file command, why did both two files encoded with big5 and gb2312 present iso-8859-1? Commented Feb 11, 2018 at 6:24
  • This answer is incorrect. file -i filename will fail to detect the charset on some files, which have mostly characters from one set, but some from another. Commented Aug 28, 2024 at 22:00

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.