[PATCH] D155610: [Clang][Sema] Fix display of characters on static assertion failure

Corentin Jabot via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 9 23:31:36 PDT 2023


cor3ntin added a comment.

@hubert.reinterpretcast It does not, Unicode characters are only escaped in Diagnostics.cpp, and I think this is what we want.
Currently, llvm assume UTF-8 terminal, except on Windows where we convert to UTF-16 and use the wide windows APIs (`raw_fd_ostream::write_impl`).

If we want to extend that - IE support EBCDIC, I assume this is your question -  we probably would want to modify `pushEscapedString` (Diagnostics.cpp), to consider a restricted set of characters as printable.
There are some questions in how we should do that, it could be a compile time configuration, or we need a way to 1/ detect the encoding of the environment, in a way similar to P1885 <https://reviews.llvm.org/P1885>  2/ construct the set of printable characters on that platforms.  
Trying to encode all characters < U+00FF might be a reasonable way to build such table.


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

https://reviews.llvm.org/D155610



More information about the cfe-commits mailing list