outlook - 关于 PidTagInternetCodePage、PidTagMessageCodepage、PidTagStoreSupportMask 的 MSG 说明
问题描述
MSG 格式的官方文档说明
指示 .msg 文件中的字符串属性是否是 Unicode 编码的。STORE_UNICODE_OK 设置字符串属性是否为 Unicode 编码。
指定用于对此 Message 对象上的非 Unicode 字符串属性进行编码的代码页
指示用于 PidTagBody 属性或 PidTagBodyHtml 属性的代码页
基于以上我的理解是,如果设置了 unicode 掩码,那么所有字符串属性都是unicode 编码的,即 UTF-16LE 如果没有设置掩码,那么 PidTagMessageCodepage 用于解码消息中的所有字符串属性。根据文档,非 unicode 和 unicode 属性不能同时存在。
那么, PidTagInternetCodepage 的目的是什么?它用于解码类型为 ptystring 的body或bodyhtml。
如果消息具有 unicode 存储掩码,则
Q1。我们是否使用 unicode 或 PidTagInternetCodepage 解码 PidTagBody/PidTagBodyHtml ?
如果消息是非 unicode 则
Q2。我们是否使用 PidTagMessageCodepage 或 PidTagInternetCodepage 解码 PidTagBody/PidTagBodyHtml ?
Q3。我们是否在设置 storemask 时使用 unicode,并且当它不是第一次尝试 PidTagInternetCodepage 然后 PidTagMessageCodepage for PidTagBody/PidTagBodyHtmlit 时?
Q4。如果不存在,我们该怎么办.. 默认为 1252 ?
解决方案
PR_BODY 与任何其他字符串属性(例如 PR_SUBJECT)没有什么不同——它有 PT_STRING8 和 PT_UNICODE 两种风格。
另一方面,PR_HTML 是 PT_BINARY,它将数据存储在二进制字节 blob 中。大多数 HTML 正文包含字符集作为 HTML 标头的一部分,但如果它不存在,则需要使用 PR_INTERNET_CODEPAGE。
推荐阅读
- sql-server - 服务器在几乎所有图像上都给出 503
- ios - 将线性转换为 Apple Display P3 颜色空间的方程式,反之亦然
- java - Docker for Windows、Alpine 容器 + JRE、Java 运行时环境内存不足无法继续
- r - R绘制基于提供的索引值选择列的值
- c++ - 如何解决 C++ 中文件的输入和输出问题?
- android - Xamarin:ADB 二进制文件已过时
- certificate - certutil 未导入所有证书
- mongodb - MongoDB 平均聚合无法正常工作
- mongodb - 在本机反应中发布到我的 mongo 数据库的问题
- r - 使用 R 中的两个矩阵的列执行线性回归