0

Replacement characters appear instead of some symbols of error text (the error itself doesn't matter) in build active file terminal.

enter image description here

The default system language on my computer is set to Russian, all file encodings are set to UTF-8, file doesn't contain any russian characters. I'll attach my code if needed. All VSCode settings are probably set to default (is there any way to check this?)

I've already tried to completely reinstall VSCode (followed this answer how to completely remove vs-code setting?), although it doesn't seem to solve my problem. I've also tried to change the encoding of VSCode terminal, still the result is the same.

I could not reproduce the same issue on my other device with default VSCode settings and error text appears as normal. The settings sync with normal device doesn't seem to change anything.

I'm not trying to fix the problem in code as it was purposefully created to encounter replacement characters. Sample code:

#include <stdio.h>

main(){
    return 0;
}

Terminal output: enter image description here

Shenyuan
  • 23
  • 1
  • 5
  • your `main()` has no return type, should be `void` or `int` – rioV8 Jan 03 '22 at 09:35
  • what if you run this compile command from a terminal outside VSC – rioV8 Jan 03 '22 at 09:36
  • I've purposefully deleted the return type from `main()` to encounter the problem (if the problem in code is fixed, replacement characters won't appear anywhere in terminal) – Shenyuan Jan 03 '22 at 09:39
  • 1
    You might want to set the env variable `LANG` to an empty string for GCC, forcing it write errors in English. – HolyBlackCat Jan 03 '22 at 09:45
  • I've changed the value of `LANG` env variable to `en` and it fixed my problem. Thanks! – Shenyuan Jan 03 '22 at 10:06

1 Answers1

0

To fix the problem the enviromental variable LANG need to be declared as en

enter image description here

Shenyuan
  • 23
  • 1
  • 5