Gedit and file encodings

Gnome's default file editor is gedit. It has builtin encoding auto-detection thus if you double-click a text file, chances are high that it'll recognize the encoding of the file properly. However if not, you can start gedit with the --encoding command line option.

The tricky thing about this command line option is that when you use it on a file for the first time, gedit saves the specified encoding into $HOME/.gnome2/gedit-metadata.xml and from this point on if you just double-click the file in Nautilus, gedit will open the file with that saved encoding. And the problem is that gedit does not update this encoding ever! Not if you open the file with another encoding specified on the command line and not if you save the file with a different encoding. Neither if you open the file in gedit and specify the encoding in the GUI. You can get rid of that encoding only by manually removing the respective line from gedit-metadata.xml.

I hope this a a bug and not a "feature", because a "sticky" encoding can drive one crazy (and looking just at the GUI it's not easy to guess what's going on).