<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/142568>142568</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            lldb inline diagnostics print unsupported characters to Windows terminal by default
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            lldb,
            platform:windows
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          DavidSpickett
      </td>
    </tr>
</table>

<pre>
    test.c:
```
int add(int n) { return 2 + n; }
int main() { return add(1); }
```
Compile with debug information:
```
C:\Users\tcwg>cl.exe test.c /Zi
```
Debug with lldb:
```
C:\Users\tcwg>llvm-worker\lldb-aarch64-windows\build\bin\lldb.exe test.exe
(lldb) target create "test.exe"
Current executable set to 'C:\Users\tcwg\test.exe' (aarch64).
(lldb) b main
Breakpoint 1: where = test.exe`main at test.c:2, address = 0x00000001400142b8
(lldb) run
Process 13376 launched: 'C:\Users\tcwg\test.exe' (aarch64)
Process 13376 stopped
* thread #1, stop reason = breakpoint 1.1
    frame #0: 0x00007ff6595a42b8 test.exe`main at test.c:2
   1    int add(int n) { return 2 + n; }
-> 2    int main() { return add(1); }
```
Evaluate an incorrect expression:
```
(lldb) p add("abc")
         ╦ä
         Γò░ΓöÇ error: no matching function for call to 'add'
note: note: candidate function not viable: no known conversion from 'const char[4]' to 'int' for 1st argument
```
This attempts to use what I think are unicode characters for curved lines, but this default Windows command prompt does not recognise them (neither does a Powershell, which is surprising).

Turning them off falls back to using just pipe characters:
```
(lldb) settings set show-inline-diagnostics false
(lldb) p add("abc")
error: <user expression 4>:1:1: no matching function for call to 'add'
    1 | add("abc")
      | ^~~
note: note: candidate function not viable: no known conversion from 'const char[4]' to 'int' for 1st argument
```

Ideally we would detect support for these characters in the terminal. I suspect the right "code page" might make this work.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzMVsFu2zgQ_Rr6M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