Code Page Handling of Imported and Exported Tables
You can add localization information to an installation database by importing and exporting ASCII text archive files using MsiDatabaseExport and MsiDatabaseImport. Because the database string pool uses an ANSI code page, both the database and exported Text Archive Files have code pages.
When a Text Archive File is exported from a database, the code page of the archive file is the same as the parent database. For a list of numeric code pages, see Localizing the Error and ActionText Tables.
Note
Exporting a table to a text archive file translates the control characters to avoid conflicts with file delimiters.
ASCII Text Archive Files
The ASCII Text Archive Files exported by MsiDatabaseExport are explained in the following format:
- The names of the table columns are written on the first line.
- The column formats are written on the second line.
- If the table contains only ASCII data, the third line of the text file is the table name followed by a list of the primary keys.
- If the table contains non-ASCII data and the database is stamped with a numeric code page, the code page number appears at the beginning of the third line.
- If the database contains non-ASCII data, but the database is not stamped with the numeric code page, the current system code page number is written at the beginning of the third line.
- The remaining lines of the text file are the data in the specified code page.
- If a table contains streams, MsiDatabaseExport exports each stream in the table to a separate file.
Neutral and Non-Neutral Code Pages
You can facilitate localization by starting with a database that has a neutral code page:
- A blank database has a neutral code page.
- A database that does not contain extended characters that require a code page to be represented in ASCII has a neutral code page.
For more information, see Creating a Database with a Neutral Code Page.
Neutral and non-neutral code pages have the following characteristics:
- If a Text Archive File with a non-neutral code page is imported into a database that has a different non-neutral code page, the Installer returns an error when MsiDatabaseImport is called.
- A Text Archive File that has a neutral code page can be imported into a database that has any code page.
- A Text Archive File that has any code page can be imported into a database that has a neutral code page.
- Importing a Text Archive File into a database with a neutral code page sets the code page of the database to the archive file code page. All archive files subsequently imported into the database must have the same code page as the first file.
For more information, see Determining an Installation Database Code Page and Setting the Code Page of a Database.
The Text Archive Files that are exported by MsiDatabaseExport can be used with version control systems. Use the Database Functions or a database table editor to edit the database.
You can add localization information to an installation database by using a database table editor or the Windows Installer API. For more information, see Code Page Handling of Parameter Strings.