Custom OEM to ANSI Translation

Mertech drivers support a standard OEM (DOS) to ANSI (Windows) translation based on the Windows API. When this feature is enabled, data is translated from the OEM character set to the ANSI character set before it is sent to the SQL database and then from ANSI back to OEM when the data is returned to the application. In most cases, this should NOT be used. If you aren’t sure why you might need to use this, DO NOT USE IT!

You are also able to customize the mapping value used for the OEM to ANSI translation. Custom translation can be enabled in two ways: by calling a command or by making an entry in the MERTECH.INI file. The difference between these two approaches is that the command must be added to each application and the application source code must then be recompiled. Whereas the MERTECH.INI file approach enables the custom OEM to ANSI character translation automatically for all applications.

If you plan to use customized OEM to ANSI translation, you must define the customized values before you read or write data from the SQL table. If you save data using the standard OEM to ANSI translation (or even if you do not select OEM to ANSI translation) and then subsequently enable customized translation, you may end up with unexpected character values. See the command reference for SET_CUSTOM_OEM_TO_ANSI for documentation on using the command to customize translation.

Custom OEM to ANSI Translation in MERTECH.INI

Add the new CustomOEMToANSI token to the MERTECH.INI file to define custom OEM to ANSI character translation using the INI file. The syntax for this token is:

CustomOEMToANSI <*CharEntry*>, <*OEMValue*>, <*ANSIValue*>

Argument

Description

CharEntry

Character position in the code page (0 to 255)

OEMValue

Number to be assigned to the OEM character

ANSIValue

Number to be assigned to the ANSI character

For example, the following MERTECH.INI file shows the three token entries required to customize the OEM to ANSI translation for characters 150, 151, 152 for the SQL and PostgreSQL drivers:

[MSSQL]
CustomOEMToANSI 150, 85,117
CustomOEMToANSI 151, 115,118
CustomOEMToANSI 152, 125,113

[PGSQL]
CustomOEMToANSI 150, 85,117
CustomOEMToANSI 151, 115,118
CustomOEMToANSI 152, 125,113

To include custom OEM to ANSI character translation in the migration process, you must set up the MERTECH.INI file before using the Flex2SQL Classic Migration utility.