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


  • You will probably have better luck on the gedit mailing lists or IRC channel (see here). – fkraiem Sep 27 '14 at 19:47

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.