Why does the following program
#include <stdio.h>
#include <wchar.h>
int main() {
wprintf(L"Привет, мир!");
}
print "Privet, mir!" on Linux? Specifically, why does it transliterate Russian text in Unicode into Latin as opposed to transcoding it into UTF-8 or using replacement characters?
Demonstration of this behavior on Godbolt: https://godbolt.org/z/36zEcG
The non-wide version printf("Привет, мир!")
prints this text as expected ("Привет, мир!").