首页 > 解决方案 > 关于 PidTagInternetCodePage、PidTagMessageCodepage、PidTagStoreSupportMask 的 MSG 说明

问题描述

MSG 格式的官方文档说明

  1. PidTagStoreSupportMask

指示 .msg 文件中的字符串属性是否是 Unicode 编码的。STORE_UNICODE_OK 设置字符串属性是否为 Unicode 编码。

  1. PidTagMessage代码页

指定用于对此 Message 对象上的非 Unicode 字符串属性进行编码的代码页

  1. PidTag互联网代码页

指示用于 PidTagBody 属性或 PidTagBodyHtml 属性的代码页

基于以上我的理解是,如果设置了 unicode 掩码,那么所有字符串属性都是unicode 编码的,即 UTF-16LE 如果没有设置掩码,那么 PidTagMessageCodepage 用于解码消息中的所有字符串属性。根据文档,非 unicode 和 unicode 属性不能同时存在。

那么, PidTagInternetCodepage 的目的是什么?它用于解码类型为 ptystring 的bodybodyhtml

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

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

如果消息是非 unicode 则

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

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

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

标签: outlookmapimsg

解决方案


PR_BODY 与任何其他字符串属性(例如 PR_SUBJECT)没有什么不同——它有 PT_STRING8 和 PT_UNICODE 两种风格。

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


推荐阅读