[Qt-creator] "Editing not possible" solution

Ziller Eike Eike.Ziller at theqtcompany.com
Wed Jan 21 09:49:12 CET 2015


> On Jan 20, 2015, at 11:48 PM, Pawel <pawelfaron87 at wp.pl> wrote:
> 
> Hello,
> 
> In my company we work in multinational teams. Many people uses strange file encodings and they don't plan to change it...
> In QtCreator I quite often see the "Editing not possible" error. I know that file decoding is a difficult subject, but I'm sure we can do better than this.
> 
> I've implemented simple code to help a bit. It is located in textdocument.cpp, and differs from current solution with:
> 
> - [Current solution] In functions read() when decoding with default codec fails we return error.
> - [My Solution] In functions read() when decoding with default codec fails I try all available codecs (QTextCodec::availableCodecs()), and if any one success I return success.
> 
> What do you think about this?
> 
> Full code can be reviewed here:
> https://codereview.qt-project.org/#/c/104124/

There is this bigger patch proposal https://codereview.qt-project.org/83259 which makes Qt Creator use the Mozilla universalchardet library for a better heuristic in choosing the right encoding...
Unfortunatly that adds 10k lines of code.
I’d very much prefer something in between your suggestion and that patch.

Br, Eike

> best regards
> Pawel_______________________________________________
> Qt-creator mailing list
> Qt-creator at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/qt-creator

-- 
Eike Ziller, Senior Software Engineer - The Qt Company GmbH
 
The Qt Company GmbH, Rudower Chaussee 13, D-12489 Berlin
Geschäftsführer: Mika Pälsi, Juha Varelius, Tuula Haataja
Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht Charlottenburg, HRB 144331 B



More information about the Qt-creator mailing list