4
  1. 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 under gedit, and gedit might save some encoding information as metadata to the text files during their creation?

  2. 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.

Thanks.

Tim
  • 25,177

0 Answers0