#41 cp1251 autodetect


Hello It would automatically detect encoding cp1251 (Russian encoding is often used for windows), I wrote a plugin but it seems to me that a little wrong. Help please take him to the end.


  • Nobody/Anonymous

    autodetect cp1251 plugin

  • Enrico Tröger

    Enrico Tröger - 2010-07-10
    • labels: 1168516 -->
    • assigned_to: eht16 --> nobody
  • Enrico Tröger

    Enrico Tröger - 2010-07-10

    Please report this as feature request against the Geany project.
    I don't think a plugin would be the correct solution for this.

    Detecting encodings isn't that easy. E.g. ISO-8859-1 and ISO-8859-15 can't be differentiated automatically or at least I don't know how.
    Still, Geany has a preference to set a default encoding when opening files.

  • Dimitar Zhekov

    Dimitar Zhekov - 2010-07-11

    It's impossible to distinguish cp1251 from, say, 8859-* and KOI8-R (except by analyzing character frequencies or dictionary words). You can select Edit -> Preferences -> Files and choose 1251 as "default" for new files and opening non-unicode files. Then, if you sometimes need to open a file in a different 8-bit encoding, use "More options" in the File -> Open dialog. Note that, for a file already open with the wrong encoding, Document -> Set encoding will not work. For example, converting a file improperly open as cp1251 into 8859-1 will try to map the supposedly cyrillic characters in the western charset - which is of course impossible.

  • Nobody/Anonymous

    This plugin I wrote for myself I feel more comfortable
    When designing, I use the same encoding cp1251 2 and UTF-8.
    By default, I have a UTF-8 and cp1251 determined automatically, and it works very well, I do not know how he behaves with other encodings, for most developers from Russia, they are not needed.
    At one of the forums where they discussed the editors, people complained that no auto geany determine cp1251, I shared this plugin.
    Forum Members already enjoy them and would like it to be composed of geany.
    Perhaps it should be left as a plugin, because it has not been tested with other encodings besides cp1251 and UTF-8, who can comfortably be included as needed.

  • Dimitar Zhekov

    Dimitar Zhekov - 2010-07-14

    The "default code page for opening existing files" I mentioned applies to non-unicode files only; utf8 is unicode, so Geany recognizes between 1251 and utf8 automatically. Believe me, I'm from Bulgaria, and I use 1251 and utf8 every day, without any plugin (the official 8-bit cyrillic here is 1251, for both WIN~1 and Linux). As of the code page for creating new files, that depends on what files you create more often.


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks