Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 C++ 库中的 ICU。如何获取 UChar 的 Unicode 十六进制值?例如,“a”应该等于 0x0041 ( http://www.unicode.org/charts/PDF/U0000.pdf )。
像这样简单的东西怎么样
std::cout << std::hex << std::setw(4) << std::setfill('0') << static_cast<int>('a') << '\n';
虽然它打印0061而不是打印0041,但这是正确的十六进制值a。
0061
0041
a