Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The title says pretty much most of it - I have some windows txt files, and most of them are Bulgarian with encoding windows-1251. When I open them (sublime, gedit, desktop generated icons) the files are with windows-1252 (western Europe) I can manually select the file encoding, but it get pretty much tiresome after some time.

So, how to set default encoding for non UTF encoded documents?

share|improve this question

Just set the encoding in a terminal by entering this line:

gsettings set org.gnome.gedit.preferences.encodings auto-detected "['UTF-8', 'WINDOWS-1251', 'CURRENT', 'ISO-8859-15', 'UTF-16']" 
share|improve this answer
This saved my day, another tip is the order of encoding is important to mark the priority. – Smile.Hunter Jul 26 '13 at 12:26

One technique is to create a script that invokes gedit with the --encoding option, as in Superuser question Gedit - how to set default encoding opening?

share|improve this answer
This will solve my issue with gedit, but not with the other 15 programs. BTW, Kate works as expected out of the box :) – deckoff Mar 6 '12 at 17:46

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.