Localizing CS-Library messages for clients

If an Open Server application calls a CS-Library routine with its own context structure as a parameter, any error messages that CS-Library generates as the result of the call will be in the Open Server application’s language and character set.

For example, if the context parameter for a cs_convert call indicates us_english/iso_1, CS-Library will generate a us_english/iso_1 message if the cs_convert call fails.

NoteIf a CS-Library routine takes a CS_LOCALE structure as a parameter, the localization values in this structure will override the localization values in the context parameter.

Obtaining CS-Library messages in the Open Server application’s language and character set is acceptable only if the Open Server application logs the CS-Library messages or otherwise keeps them to itself.

However, if an Open Server application will be passing CS-Library error messages back to a client, it needs to ensure that CS-Library generates messages in the client’s language and the Open Server application’s character set.

The messages need to be in the client’s language for the client to understand them.

The messages need to be in the Open Server application’s character set for two reasons:

An application can ensure that messages are generated in the correct language and character set by setting up a properly localized CS_CONTEXT structure for each client thread and then using these CS_CONTEXT structures when calling CS-Library routines on behalf of clients.

For information on how to localize a CS_CONTEXT structure, see “Localizing a CS_CONTEXT structure”.