Hi!
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: http://lists.uvena.de/geany/2007-June/001152.html
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.
Rgds, Alexey
On Mon, 05 Oct 2009 17:12:00 +0400, Alexey wrote:
Hi!
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: http://lists.uvena.de/geany/2007-June/001152.html
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.
It's an awesome idea! Thanks a lot, patch applied and committed in SVN r4294.
I left out the part updating po/ru.po because I chose slightly other description texts in the preferences dialog. I hope Frank will take care of merging your changes with the existing strings :).
Thanks, Enrico
On Sun, 11 Oct 2009 12:53:03 +0200 Enrico Tröger enrico.troeger@uvena.de wrote:
I left out the part updating po/ru.po because I chose slightly other description texts in the preferences dialog. I hope Frank will take care of merging your changes with the existing strings :).
Should be done in svn now. I hope I didn't mess it up ;)
Regards, Frank
-----Original Message----- From: Enrico Tr?ger enrico.troeger@uvena.de To: geany-devel@uvena.de Date: Sun, 11 Oct 2009 12:53:03 +0200 Subject: Re: [Geany-devel] Default ASCII charset for open files
On Mon, 05 Oct 2009 17:12:00 +0400, Alexey wrote:
Hi!
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: http://lists.uvena.de/geany/2007-June/001152.html
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.
It's an awesome idea! Thanks a lot, patch applied and committed in SVN r4294.
I left out the part updating po/ru.po because I chose slightly other description texts in the preferences dialog. I hope Frank will take care of merging your changes with the existing strings :).
Thanks, Enrico
-- Get my GPG key from http://www.uvena.de/pub.asc
ATTACHMENT: application/pgp-signature _______________________________________________ Geany-devel mailing list Geany-devel@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
Glad to hear that:) Please note, that aplying my patch "as is" would change previous behaviour that was added on this request: http://lists.uvena.de/geany/2007-June/001152.html. If you want to keep both, you'll need to change settings interface adding another charset selector. Also I had an idea (for which I unfortunately have no time now) to remove all Unicode charsets from the selector (so that user would be able to select only non-Unicode charset as default for non-Unicode files).
Regards, Alexey