[Geany-devel] Search in files & encodings
ban-ubuntu at xxxxx
Sat Nov 15 19:12:17 UTC 2008
Enrico Tröger a écrit :
> But there are a few problems with that:
> we run 'grep [options] search text' in the chosen directory. So, we run
> one command for all files in this directory (and maybe subdirectories).
> So we need one search text for all files.
> Additionally, to search every file with its own encoding would mean to
> read every file before to detect its encoding. So, we would read the
> file, detect its encoding and then search it with grep. Bah.
> Alternatively, to be more effective it'd be better to directly search
> the file after opened it to detect the encoding. But this would
> rewriting almost all of the current code.
Hum, yes, seen this way it seems hard to implement. Bah, 'was just an idea.
> And last but not least is there still our most loved problem of
> correctly detecting file encodings. This has never been worked reliable.
> (i.e. try to open a cp1251 encoded file in Geany, it opens as
> ISO-8859-1 except your system locale is cp1251 too).
Hum yes, I know this is hard. And you're right, if the detection fails
the problem remains.
There's just too many (useless) encodings around here I think.
>> encoding. Furthermore, sometimes users don't or won't care (and don't
>> know) about file encodings, for example if they work with files created
>> with another editor or another system.
> I completely agree with you on that but I don't know a better way, see
Hum yes. Well, if the now current behaviour is efficient for how need
it, it's cool (for me there's no change since I only use UTF-8).
More information about the Devel