How can you code in notepad? That is just asking for trouble. At least take Notepad++.
When you look at the internals, you see that UTF-8 is extremely well designed and almost always works nicely with everything except notepad and cmd.com. When your source file is UTF-8 encoded (which IMHO it should always be) and the terminal program is set to UTF-8 (which it also should always be), then you can even compile with a compiler that doesn't support UTF-8. I don't even use html entities anymore - I just deliberately save in UTF-8, put the encoding in the head (for Windows) and use Unicode all I want. IMHO, we should really seek to encode */everything in the world/* in UTF-8 and dismiss all other encodings. (wishful thinking) Viktor On 11.08.2016 23:07, Henry Skoglund wrote: > On 2016-08-11 19:53, Mark Gaiser wrote: >> On Thu, Aug 11, 2016 at 6:29 PM, Thiago Macieira >> <thiago.macie...@intel.com <mailto:thiago.macie...@intel.com>> wrote: >> >> On quinta-feira, 11 de agosto de 2016 11:40:46 PDT Mark Gaiser >> wrote: >> > Is there any way that i can use a string with unicode code >> points within >> > tr(...) that works on MSVC 2010 (as that is my setup), but it >> would be >> > great if it also works under MSVC 2015 and MinGW. >> >> There's no way to make that work with MSVC 2010. If you want this to >> work, >> your options are: >> > .. > .. >> The only option i seem to have left for 2010 are apparently: >> - Making sure the source files are UTF-8 formatted (most is ascii at the >> moment) >> - Using tr("Coördinaat"); as opposed to tr("Co\u00F6rdinaat");, that >> does work, but is not preferred. > > Actually it's possible to use unicode code points in tr(...) you just > have to know how to play hardball with the compiler :-) > > Instead of trying to play nice with tr("Co\u00F6rdinaat"); you use > tr("Co\xC3\xB6rdinaat"); > > Yes \uC3B6 is the UTF-8 encoding of the Unicode code point U+00F6 > (if you type in tr("Coördinaat") and then hexdump the .exe file you'll > see those bytes.) > > Effectively you're saying to the compiler: don't mind us hex bytes > passing, we're not the unicode characters you're looking for. This > works as long as none of the 2, 3 or 4 UTF-8 characters are null chaps. > > I've used this trick on MSVC2012 and MSVC2013, so it should work in > MSVC2010 as well. (The reason: usually I code (Swedish) characters > with tr("Coöordinaat"); but this is brittle, because then Notepad > becomes your enemy. If you're tired one day and make a quick edit in > Notepad on your mainwindow.cpp, Notepad "helps" your by inserting the > BOM and *BOOM* tr("Coördinaat") does not longer compile correctly, but > tr("Co\xC3\xB6rdinaat") does.) > > Rgrds Henry > > > _______________________________________________ > Interest mailing list > Interest@qt-project.org > http://lists.qt-project.org/mailman/listinfo/interest -- Viktor Engelmann Software Engineer The Qt Company GmbH Rudower Chaussee 13 D-12489 Berlin viktor.engelm...@qt.io +49 151 26784521 http://qt.io Geschäftsführer: Mika Pälsi, Juha Varelius, Mika Harjuaho Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht Charlottenburg, HRB 144331 B <http://qt.io> <http://www.facebook.com/Qt> <http://www.twitter.com/qtproject> <https://www.linkedin.com/company/the-qt-company/> <https://plus.google.com/104580575722059274792> <https://www.youtube.com/QtStudios>
<<attachment: viktor_engelmann.vcf>>
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest