{"id":2353,"date":"2006-03-27T12:32:00","date_gmt":"2006-03-27T12:32:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/heaths\/2006\/03\/27\/specifying-the-code-page-for-patch-tables\/"},"modified":"2006-03-27T12:32:00","modified_gmt":"2006-03-27T12:32:00","slug":"specifying-the-code-page-for-patch-tables","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/setup\/specifying-the-code-page-for-patch-tables\/","title":{"rendered":"Specifying the Code Page for Patch Tables"},"content":{"rendered":"<p>Code pages describe a character set. In <a href=\"\/heaths\/archive\/2005\/10\/05\/477577.aspx\">MSI Databases and Code Pages<\/a> I described how Windows Installer databases use a code page for the string pool, as well that the summary information stream uses its own code page in <code>PID_CODEPAGE<\/code> (1) to describe strings in the summary information stream. There is a bug, however, when creating a <i>.msp<\/i> patch database from a <i>.pcp<\/i> patch creation database using <a href=\"http:\/\/msdn.microsoft.com\/library\/en-us\/msi\/setup\/patchwiz_dll.asp\"><i>PatchWiz.dll<\/i><\/a>. The code page of the <i>.pcp<\/i> database is not set in the <i>.msp<\/i> patch, so non-ASCII character don&#8217;t show up correctly. You can verify this using the <a href=\"http:\/\/msdn.microsoft.com\/library\/en-us\/msi\/setup\/msiinfo_exe.asp\"><i>msiinfo.exe<\/i><\/a> tool in the Windows Installer SDK by passing the path to the <i>.msp<\/i> file with extended characters, and the -b and -d command-line switches (in that order). This will show the code page of the database and show you the string pool. The code page for the <i>.msp<\/i> database itself is 0. The code page for the transforms in the patch are still correct, so your target database is transformed correctly.<\/p>\n<p>This can still be a problem, however, since starting with Windows Installer 3.0, patches are displayed automatically in the Add\/Remove Programs (ARP) control panel applet using the <a href=\"http:\/\/msdn.microsoft.com\/library\/en-us\/msi\/setup\/msipatchmetadata_table.asp\">MsiPatchMetadata table<\/a> in the <i>.msp<\/i> file itself. Since the characters aren&#8217;t displayed right and the code page is not set, the ARP entry for the patch may not appear correctly either.<\/p>\n<p>To fix this you can either export the MsiPatchMetadata table to a <a href=\"http:\/\/windowssdk.msdn.microsoft.com\/library\/en-us\/msi\/setup\/text_archive_files.asp\">text archive file<\/a> and fix the strings, or have an archive file already prepared. Make sure it includes the code page as the first field in the third line, like in the following example:<\/p>\n<p><font face=\"monospace\">Company&nbsp;Property&nbsp;&nbsp;&nbsp;&nbsp;Value<br \/>\nS0&nbsp;&nbsp;s0&nbsp;&nbsp;S0<br \/>\n932&nbsp;MsiPatchMetadata&nbsp;&nbsp;&nbsp;&nbsp;Company&nbsp;Property<\/font><\/p>\n<p>When you import the archive file it replaces the existing table and in this example sets the database code page to 932 for support of the Japanese character set. Be sure not to override a code page that has been set for the database already or characters in other tables may not display correctly. A database may have only a single code page since it uses a shared string pool.<\/p>\n<p>You can import and export tables using Orca from the <b>Tables<\/b> menu, clicking either the <b>Export Tables<\/b> or the <b>Import Tables<\/b> menu. Programmatically you can use the <a href=\"http:\/\/windowssdk.msdn.microsoft.com\/library\/en-us\/msi\/setup\/msidatabaseexport.asp\"><code>MsiDatabaseExport<\/code><\/a> and <a href=\"http:\/\/windowssdk.msdn.microsoft.com\/library\/en-us\/msi\/setup\/msidatabaseimport.asp\"><code>MsiDatabaseImport<\/code><\/a> functions, or the <a href=\"http:\/\/windowssdk.msdn.microsoft.com\/library\/en-us\/msi\/setup\/database_export.asp\"><code>Database.Export<\/code><\/a> and <a href=\"http:\/\/windowssdk.msdn.microsoft.com\/library\/en-us\/msi\/setup\/database_import.asp\"><code>Database.Import<\/code><\/a> automation methods.<\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Code pages describe a character set. In MSI Databases and Code Pages I described how Windows Installer databases use a code page for the string pool, as well that the summary information stream uses its own code page in PID_CODEPAGE (1) to describe strings in the summary information stream. There is a bug, however, when [&hellip;]<\/p>\n","protected":false},"author":389,"featured_media":3843,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[20],"class_list":["post-2353","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-installation"],"acf":[],"blog_post_summary":"<p>Code pages describe a character set. In MSI Databases and Code Pages I described how Windows Installer databases use a code page for the string pool, as well that the summary information stream uses its own code page in PID_CODEPAGE (1) to describe strings in the summary information stream. There is a bug, however, when [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/posts\/2353","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/users\/389"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/comments?post=2353"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/posts\/2353\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/media\/3843"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/media?parent=2353"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/categories?post=2353"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/tags?post=2353"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}