[PATCH] D157986: [Cmake] Make sure MSVC knows LLVM source files are UTF-8 encoded

Corentin Jabot via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 15 08:32:30 PDT 2023


cor3ntin added a comment.

In D157986#4588645 <https://reviews.llvm.org/D157986#4588645>, @aaron.ballman wrote:

> Before you land the changes: how would this impact test files that are intentionally not encoded in UTF-8 (assuming we have any to test our failure behavior)?

We have no such test (yet) afaik - but we do have tests that are intentionally not valid utf-8 (which are never opened by MSVC)

I presume MSVC would load the files up fine and since MSVC isn't compiling them, there's not an issue.

> But does this option change source editor behavior? e.g., if someone opens the file up, will they get invalid UTF-8 displayed to them? Will saving the file automatically try to encode it as UTF-8?

Nope, the editor has separate options. I believe files are opened in the current locale encoding and save as such, unless that fails in which case it falls back to utf if the right setting is enable.
presence of an `editorconfig` file or a BOM can also affect that.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D157986/new/

https://reviews.llvm.org/D157986



More information about the llvm-commits mailing list