[Geany-devel] Default ASCII charset for open files

Alexey Antipov 1a_antipov at xxxxx
Mon Oct 5 13:12:00 UTC 2009


I have recently faced a problem with charset detection in Geany. I have a UTF-8 locale on my Ubuntu machine, but my company uses mostly Windows, so a majority of text files is in CP1251. My issue is very similar to that one:

Since then, there is an option to "force" all files open in some selected charset (e.g. 1251). IMHO it's not absolutely convenient, because it completely ignores all other settings, especially BOM. 

My idea is to add a selected charset not as "forced", but as "preferred ASCII" (meaning that if file is non-Unicode, then it should be opened using "charset"). As many Linux distros are now moving towards Unicode as default system locale, that would be a convenient and a predictable behaviour.

By default, Geany takes the first (by order) charset for non-Unicode files (that's ISO-8859-1). I have created a patch to allow user select that ASCII charset. Please take a look at this patch and tell me if that is a good idea.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: charset_detection.patch
Type: application/x-patch
Size: 6875 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/devel/attachments/20091005/36485db0/attachment.bin>

More information about the Devel mailing list