大网数据广告活动
安装更新与部署

Code Page Handling (Windows Installer)

· 52CE 我爱测

The Windows Installer stores all database strings in a single shared string pool to reduce the size of the database, and to improve performance. For a list of numeric code pages, see Localizing the Error and ActionText Tables.

The Windows Installer stores all database strings in a single shared string pool to reduce the size of the database, and to improve performance. For a list of numeric code pages, see Localizing the Error and ActionText Tables.

For more information, Determining an Installation Database's Code Page.

Windows Installer uses IsValidCodePage to determine whether the code page is valid.

Localizing a Windows Installer Package

If you localize a Windows Installer package, it may involve modifying information in database tables, exporting the tables to ANSI text archive files, and then importing the archive files into the database that is being localized. You can also add localization changes to a database by using a database table editor or the Database Functions. It is important to set the code page of the database that is being localized before you make any localization changes to the database. Do not set the code page of the database after localizing the database, because this can corrupt extended characters. For more information, see Setting the Code Page of a Database.

The recommended approach for handling code pages is to author a neutral database that only contains characters that can be translated into any code page. For more information, see Creating a Database with a Neutral Code Page.

If you add localization information with database archive files, you can use MsiDatabaseExport to export tables from a database that contains localization changes to ANSI text archive files, and then import these into the database being localized with MsiDatabaseImport. The code page of an exported archive file is always the same as its parent database. The code pages of an imported file and the database that is receiving the file must be identical, or at least one of the two code pages must be neutral. For more information, see Code Page Handling of Imported and Exported Tables.

If you add localization information with a text editor or the Database Functions be careful to only pass string parameters to the Windows Installer API that uses the code page of the database that is being localized. If a string parameter contains characters not represented by the code page of the database, an error occurs when calling MsiDatabaseCommit. For more information, see Code Page Handling of Parameter Strings.

If one package is used to install multiple language versions of a product, the transform that is used to localize strings can also change the code page of the database.

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 05/31/2018
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。