Issues due to differences in file encoding can sometimes be elusive and frustrating. I’ve found a few little tricks to uncover where the issue exists and to fix the problem.
If you have an idea of which file the characters are, you can use cat to display all characters and adds a $ to the end of your lines so that you can confirm that there are no special characters hiding in each line.
1 2 3 4 5
Determine what character encoding is used by a file like so…
Use VIM to change a file’s encoding
You will only notice a difference if you add utf-8 characters. Most characters on the keyboard will create a unicode equivalent if you hold down the alt key.
Change a files encoding via athe command line