visual-studio-codeencodingcharacter-set

Diamond with question mark (replacement character) in VSCode terminal


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


Solution

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

    enter image description here