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++ 手册时,它这样描述wchar_t,
wchar_t 宽字符 - 2 或 4 个字节 1 个宽字符
它让我思考如何在 MySQL 中存储wchart _t 类型的数据(如汉字)?
wchar_t不知道字符编码。Awchar_t可能(理论上)甚至是 1 或 8 个字节。MySQL 知道字符编码。因此,没有适合所有目的的答案。确保 MySQL 和 C++ 代码中的编码相同。
wchar_t