Skip to content

Setting Character Formats

Determining the Character Format of a Table

Each table's .INT file should contain information about how the data is stored. You will have a line in this file that looks like:

TABLE_CHARACTER_FORMAT OEM

Or, if you set the character format to ANSI/Unicode, the line will look like:

TABLE_CHARACTER_FORMAT ANSI

If your .INT file does not contain this setting, it indicates that the file was created with an earlier version of the driver and has not yet been modified by the newer driver. When missing, the format is assumed to be ANSI. The TABLE_CHARACTER_FORMAT tells the driver (and you) what the current character format for a table is. You must be very careful if you change this value! Changing the value does not change the data. This can result in the driver making improper translations. If you need to change the character format of a table, you should use a conversion utility.

You can safely change this value if the table is empty. You might do this if you wish to set a table's character format before adding or converting data. Normally, you will never need to do this. Instead, you can set a default character format for all new tables as described below.

Defining the Default Character Format for New Tables

When creating new tables, DataFlex must know what character format to use when creating the table definition. It does this by looking at a setting in your driver configuration file called DEFAULT_TABLE_CHARACTER_FORMAT (equivalent to the DF_DRIVER_DEFAULT_TABLE_CHARACTER_FORMAT attribute):

DEFAULT_TABLE_CHARACTER_FORMAT [OEM | ANSI]

This setting determines what format will be used when defining and creating a new table. It determines whether the table's TABLE_CHARACTER_FORMAT will be set to OEM or ANSI/Unicode. This setting ensures that table conversions save the data in the proper character format.

If your configuration file does not contain the DEFAULT_TABLE_CHARACTER_FORMAT setting or the file is missing, the default will be ANSI/Unicode. We advise that you explicitly set this value in your configuration file.

For more information on the driver configuration file, see Driver Configuration.

Recommendations

  1. We recommend that all of the tables in any database use the same character format.
  2. Existing tables created by earlier versions of DataFlex are most likely using OEM format. These will continue to work properly but cannot store Unicode data. If you are using ANSI as your default character format, we advise that you convert the format of any existing OEM tables to ANSI (see Converting Table Formats).

See Also