[Development] MSVC 2015 option /utf8: Qt only or everyone?

Thiago Macieira thiago.macieira at intel.com
Wed May 11 19:52:43 CEST 2016

On quarta-feira, 11 de maio de 2016 18:27:29 PDT André Pönitz wrote:
> On Wed, May 11, 2016 at 07:59:38AM +0000, Lars Knoll wrote:
> > Finally!
> > 
> > We should certainly turn it on for Qt.
> TBH, I don't see much of an advantage. Qt sources are (or should
> have been) 7-bit clean and this still looks like a sensible "least
> surprise" approach in general for any intended-to-be-portable code base.

They are, which means we will not see immediate benefit to our own code by 
turning this on. And since we'll still have to cope with MSVC 2013 and the 
early versions of 2015, we won't be able to make use of it for some time.

But it will eventually allow us to write UTF-8 directly inline in our sources.

> I understand that being able to use UTF-8 could make some tests
> more readable, so I am not really opposed to the idea, it's just
> that it doesn't look like a big win in total.

Fair enough.

> > User code is a bit more sensitive. What are we currently doing on the
> > other compilers? Are we assuming utf8 as the input encoding by
> > default? If yes, we should aim for consistency and turn it on for user
> > code on msvc2015 as well, but there should be an option to disable it
> > and we'd need to clearly document this in the Changelog.
> One question is what happens with files that have non-uniform
> encodings in comments which seemed to be a rather common phenomenon
> at a time. It's unclear to me after reading the blog post.
> I don't know how modern MSVC react to them, but it used
> to just ignore any junk in comments (like one \author entry with
> Latin1 encoded umlauts and the next one with UTF-8 encoding)

That's a good question. I haven't tested the option myself yet, but I guess 
we'll learn more soon.

Clearly, there's no need to rush here.

Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

More information about the Development mailing list