[Qt-creator] "Editing not possible" solution
Harri Pasanen
harri at mpaja.com
Wed Jan 21 22:45:26 CET 2015
Hi,
utf-8 is fine for Asian languages.
It is much easier to mandate a source encoding than try to deal with many.
iconv is your friend there, use that to convert your files to utf-8 in
the command line.
Once you have many, things like source repository browsers, web viewers
etc. all run into problems.
Personally I think it is misguided effort to add support for multiple
encodings in Qt Creator.
Just my 2 cents,
Harri
On 01/21/2015 09:36 PM, Pawel wrote:
> 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
> <mailto: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/
>
>
> ------------------------------------------------------------------------
> <http://www.avast.com/>
>
> This email has been checked for viruses by Avast antivirus software.
> www.avast.com <http://www.avast.com/>
>
>
>
>
> _______________________________________________
> Qt-creator mailing list
> Qt-creator at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/qt-creator
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qt-creator/attachments/20150121/5e702f11/attachment.html>
More information about the Qt-creator
mailing list