Internationalization of DataBlade® API modules (GLS)

For your DataBlade® API module to work in any HCL Informix® locale, you must implement your DataBlade® API module so that it is internationalized. That is, the module must not make any assumptions about the locale in which it will execute.

Server only: A C UDR inherits the server-processing locale as its current processing locale. The database server dynamically creates a server-processing locale for a particular session when a client application establishes a connection. The database server uses the client locale, database locale, the server locale, and information from the client application to determine the server-processing locale. For more information about how the database server determines the server-processing locale, see the Informix® GLS User's Guide.
Client only: A client LIBMI application performs its I/O tasks in the client locale. Any database requests that the application makes execute on the database server in the server-processing locale.

This section provides the following information about how to internationalize a C UDR and the support that the DataBlade® API provides for internationalized UDRs.

An internationalized C UDR must handle the following GLS considerations.
GLS consideration for an internationalized UDR DataBlade® API function
What considerations must the C UDR take when copying character data? None
How can the C UDR access GLS locales? function library
How does the UDR handle code-set conversion? mi_get_string(), mi_put_string()

function library

How does the UDR handle locale-specific end-user formats? mi_date_to_string(), mi_decimal_to_string(), mi_interval_to_string(), mi_money_to_string(), mi_string_to_date(), mi_string_to_decimal(), mi_string_to_interval(), mi_string_to_money()
How can the C UDR access internationalized exception messages? mi_db_error_raise()
How can the C UDR access internationalized tracing messages? GL_DPRINTF, gl_tprintf()
How do opaque-type support functions handle locale-sensitive data? mi_get_string(), mi_put_string()
How to you obtain names of the different locales from within a C UDR? mi_client_locale(), mi_get_connection_info()

For more information about how to handle these GLS considerations within a C UDR, see the section on database servers in the Informix® GLS User's Guide.