UniGetTable

Gets a table cookie for the specified code page.

Library:LibC
Service:Characters and Strings

Syntax

  #include <unilib.h> 
   
  int UniGetTable (
     int               codePage,
     UniRuleTable_t   *table);
  

Parameters

codePage

(IN) Specifies which code page to obtain a translation table for. Pass in the number of the code page. For a list of supported code pages, see Section 12.1, Supported Code Pages.

table

(OUT) Points to the cookie for the translation table or to -1 (UNI_LOCAL_DEFAULT) if an unsupported code page is passed in the codePage parameter.

Return Values

If successful, returns 0. Otherwise, returns a negative error code and the value of table is undefined.

Decimal

Name

Description

-488

UNI_ERR_BAD_CODEPAGE

The specified code page is unsupported.

-494

UNI_ERR_MEM_ALLOC

No memory is available for allocation.

-498

UNI_ERR_TABLE_CORRUPT

Table corruption has been detected.

-501

UNI_ERR_FILE_OPEN

Unable to open the table file.

-504

UNI_ERR_FILE_READ

Unable to read the table file.

Remarks

A component, service, or application must explicitly request that a table be loaded and pass the cookie associated with that table to functions requiring table information to perform their task. Table cookies are obtained by calling UniGetTable. The corresponding call to dispose of these tables is UniDisposeTable.

The table files are located in an nls subdirectory of the one where server.exe was installed. If the UniGetTable function yields I/O errors when opening a previously unused code page table for reading, the most likely reason is that the file is absent or corrupted. The name of the file corresponds closely with the value passed in codepage parameter.

NOTE:The default translation table for the host's local code page is always loaded and available. This can be obtained by passing UNI_LOCAL_DEFAULT in place of table to any function requiring it.

For sample code, see UniLib.c.

See Also