Part 1 on encoding characters in C++ (by User123).
I am making an intermediate program, where I need to display some special character, which is in Czech named háček (or c with caron): č. It has Unicode code \u010D. But when I run the program, I get some other character (big R with caron, I think): Ř. I don't see exactly in the terminal.
I have read a lot of articles about UTF and Unicode. Does Visual Studio has different encoding as terminal? Is the computer confused?
My example code (but not real) is as follows:
#include <iostream>
int main() {
std::cout << "\u010D";
}
I have this output:
Ř
I tried also with printf
function, but the same result.
Is there any similarity between these two encodings?
č | Ř
-------------------------------
dec | hex | dec | hex
269 | U+010D | 344 | U+0158
196 141 | C4 8D |197 152| C5 98
č | č | Ř| Ř
Thank you!