How does gedit detect the encoding of a text file when opening it?
I notice that gedit can always find the correct encoding when opening a text file of mine, while chardet can often fail to and emacs can sometimes fail too. Is it because i created the text files created under gedit, and gedit might save some encoding information as metadata to the text files during their creation?
can I run gedit in command line to detect encoding of a text file, just like chardet does? That will be convenient when I want to write shell commands for batch processing text files.