This content has been marked as final. Show 2 replies
The content of your file must have a "magic number" near the beginning, which tells the OS what type of file its. The man pages for "file" command will have more detailed info. The content of the file also needs to contain non-ascii characters to be eligible. For instance, there is no point to interpret US-ASCII characters as UTF-8 because they are identical.
Consider the following:
echo -e "\0220" > test.txt file test.txt test.txt: Non-ISO extended-ASCII text iconv -f iso-8859-1 -t UTF-8 test.txt > test.utf file test.utf test.utf: UTF-8 Unicode text cat -ev test.txt M-^P$ cat -ev test.utf M-BM-^P$