Probably a programmer read up on the fundamentals of encoding, but my specific question is
In windows Visual C output to Windows console, the unsigned char value 140 prints as unicode 0x0152 = 338.
What encoding (or “code page”?) is Visual C using? (e.g. UTF-7, ASCII). How exactly is unsigned char value 140 mapping to the unicode character 338?
I’m sure anyone can paste a link to one of the many wikipedia pages on encoding or a tables on the web, but a more specific answer to the question would be nice.
That would be encoding Windows-1252, and it’s not that Visual C is “using” it, it’s what the Windows console is interpreting the output as.
This other answer might be what you seek: What encoding/code page is cmd.exe using?
“Code page” is Microsoft’s term for “Coded Character Set” which is more or less equivalent to what you think of as an “encoding”, but see the Unicode Glossary for precise definitions.
And to quote the Wikipedia page: