[cfe-dev] Fixits with multibyte chars

Benjamin Kramer benny.kra at gmail.com
Mon Jul 16 10:47:26 PDT 2012


On 16.07.2012, at 19:32, Jordan Rose <jordan_rose at apple.com> wrote:

> Hi, everyone. We recently hit an assertion when trying to output a fixit with Unicode characters in it; it reduces down to this:
> 
> void test() {
>  printf("∆: %d", 1L);
> }
> 
> I could of course just disable fixits when there are Unicode characters involved, but I'd like to fix this the right way. The trouble is -fdiagnostics-parseable-fixits, which is supposed to be machine-readable output, and in this case is a three-byte UTF-8 character three columns or one column? I think one column is the right way to go, but I wanted to get some other opinions before I start working on a patch.

This actually depends on the system. On some systems we'll print the unicode codepoint in hex, others will get the 1 column char. There is the llvm::sys::locale::columnWidth function to get this information in a portable way.

- Ben

> I'd be getting around to this soon anyway; it's blocking PR13178 (fixit for smart quotes).
> 
> Thanks,
> Jordan
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev





More information about the cfe-dev mailing list