Property ID One

Property ID One is reserved as an indicator of which code page (Windows) or Script (Macintosh) to use when interpreting the strings in the property set. All string values in the property set must be stored with the same code page. The originating operating system value in the property set header (PROPERTYSETHEADER::dwOSVer) determines whether the code page indicator corresponds to a Windows code page or Macintosh script.

When an application that is not the author of a property set changes a property of type string in the set, it should examine the code page indicator and take one of the following actions:

  • Write the new value using the code page found in the code page indicator.

  • Rewrite all string values in the property set using the new code page (including the new value), and modify the code page indicator to reflect the new code page.

If an application cannot understand this indicator, it should not modify the property. All writers of property sets must write a code page indicator; however, if the code page indicator is not present, the prevailing code page on the reader's machine must be assumed.

Possible values for the code page are given in the Window 32 API (see the GetACP function) and Inside Macintosh Volume VI, 14-111. For example, the code page US ANSI is represented by 0x04E4 (1252 in decimal) while the code page for Unicode is 0x04B0 (1200 in decimal).

It is recommended that the Unicode code page be used whenever possible. Using the same code page for all property sets is the only way to achieve interoperable property sets on a worldwide basis. In the Unicode code page, note that the count at the start of a VT_LPSTR or VT_BSTR or other eight-bit character quantities in the property set is a byte count and not a character count. This byte count includes the two zero bytes at the end of the string.

Property ID one is a VT_12 type and thus starts with a DWORD containing the value VT_12 followed by a USHORT indicating the code page.

Software for developers
Delphi Components
.Net Components
Software for Android Developers
More information resources
Unix Manual Pages
Delphi Examples