[Qt-creator] "Editing not possible" solution

Pawel pawelfaron87 at wp.pl
Wed Jan 21 21:36:00 CET 2015


Hi Tobias and all,

Thanks for all responses.

I've tried my solution on my source code, and it works well so far,  
although a bit slower.
So if it cannot be merged I will keep applying it privately.

I only wonder how other tools are able to cope with all files (Notepad++,  
vim , eclipse)? I mean they don't fully recognize decoding, but you are  
able to edit and save files and this is all I need. I will investigate  
Notepad++ source code and see.

I know that it would be best if all people use utf8, but the world isn't  
perfect, and you can see comments in some Asian language in source code ;)

best regards
Pawel

On Wed, 21 Jan 2015 07:38:10 +0100, Tobias Hunger  
<tobias.hunger at gmail.com> wrote:

>
> Hi Pawel,
>
> Am 20.01.2015 23:48 schrieb "Pawel" <pawelfaron87 at wp.pl>:
>> 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?
>
> I am afraid that our approach is the only one that will not silently  
> mess up your code. All others will work most of the time and then  
> suddenly break >things.
>
> An IDE should not do that, ever.
>
>> Full code can be reviewed here:
>> https://codereview.qt-project.org/#/c/104124/
>
> Thank you for the patch! I do not think that it should be applied, but I  
> appreciate the work you put in.
>
> PS: Is this an issue still? Qt5 requires all files to be utf8 encoded  
> anyway, and AFAIK so do other big C++ libs. So maybe it would make more  
> sense to >make your team mates standardized on utf8.
>
> Best Regards,
> Tobias



-- 
Using Opera's mail client: http://www.opera.com/mail/

---
This email has been checked for viruses by Avast antivirus software.
http://www.avast.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qt-creator/attachments/20150121/88b6095f/attachment.html>


More information about the Qt-creator mailing list