PidTagInternetCodePage、PidTagMessageCodepage、PidTagStoreSupportMask 上的 MSG 说明

MSG Clarification on PidTagInternetCodePage, PidTagMessageCodepage, PidTagStoreSupportMask

MSG 格式的 official documentation 状态

  1. PidTagStoreSupportMask

indicates whether string properties within the .msg file are Unicode-encoded or not. STORE_UNICODE_OK Set if the string properties are Unicode-encoded.

  1. PidTagMessageCodepage

specifies the code page used to encode the non-Unicode string properties on this Message object

  1. PidTagInternetCodepage

indicates the code page used for the PidTagBody property or the PidTagBodyHtml property

基于以上我的理解是,如果设置了 unicode 掩码,那么所有字符串属性都是 unicode encoded 即 UTF-16LE 如果未设置掩码,则使用 PidTagMessageCodepage 解码消息中的所有 String 属性。 基于 the documentation 非 unicode 和 unicode 属性不能同时存在。

那么,PidTagInternetCodepage 的用途是什么?它用于解码类型为 ptystring 的 body or bodyhtml

如果消息具有 unicode 存储掩码,则

Q1。我们是使用 unicode 还是 PidTagInternetCodepage 解码 PidTagBody/PidTagBodyHtml?

如果消息是非 unicode 则

Q2。我们是使用 PidTagMessageCodepage 还是 PidTagInternetCodepage 解码 PidTagBody/PidTagBodyHtml?

Q3。我们是否在设置 storemask 时使用 unicode,并且当它不是首先尝试 PidTagInternetCodepage 然后 PidTagMessageCodepage for PidTagBody/PidTagBodyHtmlit 时?

Q4。如果 none 存在,我们该怎么办...默认为 1252?

PR_BODY 与任何其他字符串 属性(例如 PR_SUBJECT)没有区别 - 它有 PT_STRING8 和 PT_UNICODE 两种形式。

另一方面,

PR_HTML 是 PT_BINARY,它将数据存储在二进制字节 blob 中。大多数 HTML 正文包含字符集作为 HTML headers 的一部分,但如果它不存在,您将需要使用 PR_INTERNET_CODEPAGE.