In ODBC environments, the solidDB® ODBC driver handles the conversion of data between the encoding used in the application (client) and the UTF-8/UTF-16 format in the solidDB® Unicode database. The binding of character data can be set for all clients using the server-side parameter Srv.ODBCDefaultCharBinding or per client using the client-side parameter Client.ODBCCharBinding. In both cases, the standard C type identifier SQL_C_CHAR is used.
For binding of character data, you can set the ODBC driver to use one of the following methods:
▪the current client locale encoding
▪specific encoding as defined with a locale name
▪no encoding
▪UTF-8 encoding
Two use cases are supported for all methods:
▪The same binding method is set for all clients using the server-side parameter ODBCDefaultCharBinding.
The ODBCCharBinding parameter overrides the server-side settings set by ODBCDefaultCharBinding.
The factory value for both is locale:.
▪raw — no data conversion takes place between solidDB® server and the client
The value raw can be used when you want your database to use the binding used in the 6.3 or earlier versions of solidDB®.
▪locale — the current client locale setting is used, also if set by the client system
▪locale: — the current client setting are overridden with a default locale set of the client system
The driver calls setlocale() with an empty string which effectively searches for the locale setting set in the system.
For example, in Linux environments, the environmental variable LC_CTYPE is checked first and if that is not defined, the environmental variable LANG is searched.
▪locale:<locale name> — the current client systems setting are overridden and the given locale is used
The convention for <locale name> depends on the operating system.
For example, in Linux environments, the locale name for the code page GB18030 in Chinese/China is zh_CN.gb18030. In Windows environments, the locale name for Latin1 code page in Finnish/Finland is fin_fin.1252.
▪UTF8 — UTF-8 binding is enforced regardless of the locale set in the client-side system
Note
▪IfthevalueinSrv.ODBCDefaultCharBinding isotherthanlocale,itoverrides any current system locale setting for all clients.
▪IfthevalueinClient.ODBCCharBinding isotherthanlocale,itoverridesboth the server side value (if set) and the current system locale setting.
Using the current client locale encoding (locale)
To use the current client locale encoding:
1 Configure the parameter setting:
All clients use the same binding method (server-side parameter)