# CharTable

The CharTable function allows to get information about installed character tables.

    int WINAPI CharTable(
      int Command,
      char *Buffer,
      int BufferSize
    );

### Parameters

Command
Either the number of the requested character table or one of the following commands (the FARCHARTABLE_COMMAND enum):

Command | Description
--- | ---
FCT_DETECT | Autodetect the character table for given text

Buffer
If Command is equal to FCT_DETECT, specifies the address of a buffer with text data. Otherwise, specifies the address of a CharTableSet structure that receives information about the requested character table.
BufferSize
If Command is FCT_DETECT, BufferSize should contain the size of the buffer with text data to analyze. Otherwise it is the size of the CharTableSet structure.

### Return value

-1, if the requested table is not present or autodetection failed.
If successful, the function returns the number of the requested table and fills the structure pointed by Buffer. In FCT_DETECT mode it returns the number of the detected table and does not change Buffer data.

### Remarks

1. To enumerate all FAR character tables, start with Command equal to 0 and increment it until the return value will be -1.
2. The CharTableSet structure is filled with OEM data if there where problems while reading settigs of some table (when Command does not equals FCT_DETECT).