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.
我刚开始使用 Win32 unicode 字符串 (UTF-16)。有什么方法可以快速获取字符串中任何特定字符的字节索引,因为某些字符可能使用四个字节(从我阅读 MSDN 收集的内容)?还是应该将它们都视为每个字符两个字节?
CharNext ()和CharPrev() API 可用于在 Windows 上安全地遍历 UNICODE 字符串。
要获取 UNICODE 字符串的第 n 个字符,请在循环中调用 CharNext()。