[cfe-dev] Making Clang support UTF-16 input?

Hans Wennborg via cfe-dev cfe-dev at lists.llvm.org
Fri Aug 17 00:02:26 PDT 2018


On Fri, Aug 17, 2018 at 5:14 AM, degski via cfe-dev
<cfe-dev at lists.llvm.org> wrote:
>> When trying out the new LLVM Visual Studio integration extension [1]
> that now supports VS 2017, we learned that at some point, VS changed
> the editor to encode new project files as utf-16 by default [2].
>
> The editor is not doing much in this case, as far as I can see. When
> creating a new project VS uses project templates, they contain those files
> pch.h and main.cpp pch.cpp etc in UTF-16, it's those templates that have the
> problem.
>
> Apparently someones' editor saved them to UTF-16 at some point (15.4), after
> which this problem has arisen. If I add a new source file by choosing add
> new item from solution explorer it creates an ansi file (with CF/LF
> line-endings), not UTF-16 (at least on my machine).
>
> It also seems from the comments on that bug-report being presented as a
> feature that not many peops are happy with it. Some comment states:
>
> UTF-16 doesn't work well with most compilers, especially cross platform.
> UTF-16 doesn't work well with SVN.
> UTF-16 doesn't work well with GIT.
>
> someone else notes clang-tidy would need to change as well.
>
> which seem good enough reasons for MS to me to revert it (i.e. re-save the
> files in the templates as ansi files, and problem is gone).
>
> To summarize, I would not change clang.

What you say makes sense. I won't worry about it, then.



More information about the cfe-dev mailing list