In this example, a .txt file was created in Windows Notepad, and the file contains the special character â.
When attempting to view this file using a Linux text editor, the â character may not be displayed. This problem occurs because the text editor or the Linux system may not use a character encoding standard that supports the â character.
One solution to this problem is to update the LC_ALL variable in the /usr/bin/locale file to use a character encoding standard that supports the â character, such as UTF8.
The Linux text editor now properly displays the â character.
However, setting the LC_ALL variable to use UTF8 may not be an ideal solution, because this would update the entire operating system to use UTF8. The iconv command can be used to update the file to use UTF8.
The iconv command with the -f or --from-code and -t or --to-code options can be used to convert a file from a certain character encoding standard to another character encoding standard. For example, to convert example.txt from ISO-8859-15 to UTF8, and to make a new file named newfile.txt.
[root@server1 ~]# iconv -f iso-8859-15 -t UTF-8 /home/user1/example.txt > /home/user1/newfile.txt
newfile.txt will properly display the â character.