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.
我正在读取一个 UTF-16LE 文件作为字节并将其发送到 CRichEditControl。我发现如果 BOM 存在,则编辑控件无法正确显示其上下文。
我的问题:剥离 BOM 是我的责任,还是我需要在编辑控件上设置不同的选项?
您应该始终将数据作为 UTF-16 LE 发送到富编辑控件,因为这是 Windows 用于所有字符串的标准。BOM 不是有效的 UTF-16 字符,因此您应该将其去掉。