📜 ⬆️ ⬇️

Plugin to quickly change the encoding of an open file in Gedit

In Gedit, you can choose the file encoding when opening it. And when opening files in the encoding that is different from the system one in Gedit, there are problems of cracking. It seems that there is an autodetection of the encoding, but it never worked for me :-(.

Manually selecting the encoding is a bit tiring: You need to find the file, select the next encoding from the drop-down list and click on the open button. After that, if you're lucky, you can start editing. If not, you need to repeat the same steps again, even though the open file dialog will already show the contents of the current document folder, it doesn’t become much easier if there are many files in the folder. An even more problematic situation is when you open a file, in which, for example, the text in Russian is somewhere in the middle, and in the beginning is the English text. In such a situation, in order to make sure that the encoding was chosen correctly, you will have to spend time on getting to the middle of the file :-(

Certainly this situation annoyed me and I decided to write my own plugin. I didn’t have time to write a lot, I guessed to read the Gnome's bagzilla. In it, Vladisla Gorbunov laid out his plugin, which allows you to change the encoding of the open file on the fly, without performing this tedious procedure.

After installing this plugin, the File menu will look like in the screenshot.
image
')
How to install this plugin. Download the archive attached to this message (buggy is buggy and successfully download the latest version attached to this message is not always obtained). Unpack the contents of the archive into the folder ~ / .gnome2 / gedit / plugins / . Open Gedit and in the Edit - Options - Modules dialog enable the plugin Encoding .

By the way, in Gedit 2.26, it is planned to add the ability to change the encoding of an open file on the fly (see RoadMap ).

UPD: In the comments Jama suggested how to resolve the situation, so that gedit opens files in cp1251 encoding by default, instead of koi8r.
gconf-editor
apps - gedit-2 - preferences - encodings - auto_detected
cp1251 put higher than koi8r

Source: https://habr.com/ru/post/47005/


All Articles