[Interest] Unicode code points in Vusual Studio. Output differs from MinGW

Mark Gaiser markg85 at gmail.com
Thu Aug 11 19:53:54 CEST 2016


On Thu, Aug 11, 2016 at 6:29 PM, Thiago Macieira <thiago.macieira at 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:
>
>  a) upgrade to MSVC 2015 Update 3 and add the "-utf-8" option to
> QMAKE_CXXFLAGS.
>
>  b) upgrade to MSVC 2015 any version and write:
>         tr(u8"Co\u00F6rdinaat")
>   note: it's very likely that lupdate does *not* understand this! if that's
>   the case, file a bug report and "hide" the u8 with a macro
> #define tr(x)           tr(u8 ## x)
>
> Or, your fallback option: stop using unicode literals.
>
> Hi Thiago,

Thank you for the clear options.
I was hoping for some magic compile flag to fix this on MSVC 2010, but
apparently i'm out of luck.

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20160811/ec1c16c1/attachment.html>


More information about the Interest mailing list