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# Outlook 互操作类来处理 .msg 文件(从 Exchange 服务器保存)。
邮件用不同的 mail.InternetCodepage 保存,因为我需要邮件的内容(= mail.Body),我必须根据邮件的代码页将 mail.body 解码为 utf8。
可以为每个可能的代码页编写一个“IF codepage = 1234 ..”,但我认为有更好的方法......
首先,如果您生成 Unicode MSG 文件,代码页 (PR_INTERNET_CPID) 将无关紧要。
其次,Outlook 对象模型(因为它是基于 IDispatch 的 COM)只处理 UTF-16 字符串,因此 Outlook 对象模型会为您执行所有转换。