Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
DB Access Module for Oracle OCI User's Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

2.10 Internationalization

The DB Interface Module internationalization features are available in the DB Access Module for Oracle OCI subject to the restrictions given in the following sections.

2.10.1 Prerequisites

This section discusses prerequisites.

2.10.1.1 Environment Variables

The DB Access Module for Oracle OCI does not require any specific client setting to insert or read data if your database is set up correctly to use UTF-16 encoding. However, you are advised to set the appropriate NLS_LANG in your operating system environment or Windows registry to customize the behavior of the Oracle OCI client. For customized error messages, you must set the correct locale in your environment along with NLS_LANG. NLS_LANG should be set before executing the application.

2.10.1.2 Database NLS_NCHAR_CHARACTERSET

To use internationalization features, your database should be created with NLS_NCHAR_CHARACTERSET set to AL16UTF16 or AL32UTF8. If it is set to AL32UTF8, a conversion between UTF-16 and UTF-8 encodings is initiated on the server side.

All data passed to and read back from the DB Access Module for Oracle OCI with Oracle data types NCHAR and NVARCHAR2 should be in UTF-16 encoding.

2.10.1.3 Database Length Semantics

NLS_LENGTH_SEMANTICS of the Oracle database can be set to byte or character semantics. Tables created under byte semantics are different than tables created under character semantics. Table created under byte semantics specify column length in bytes. Tables created under character semantics specify column length in characters. Both types of semantics are implemented as is from Oracle; the DB Access Module for Oracle OCI does not alter your statements. Please see the Oracle documentation for more details.

2.10.2 Data Bindings

The DB Access Module for Oracle OCI binds the Oracle datatypes NCHAR and NVARCHAR2 to RWBasicUString. It is recommended that all Unicode-enabled applications use type RWBasicUString (from the Essential Tools Module) or type RWUString (from the Internationalization Module) to handle all UTF-16 data.

2.10.3 Limitations

This section discusses limitations.

2.10.3.1 Using Oracle Data Types NCHAR and NVARCHAR2

All data passed to and read back from the DB Access Module for Oracle OCI with Oracle data types NCHAR and NVARCHAR2 should be in UTF-16 encoding. DB Access Module for Oracle OCI allows binding UTF-8 data using RWDBMBString; however, an internal conversion to UTF-16 will occur.

2.10.3.2 Metadata

SourcePro DB does not currently support Unicode logins, passwords, or metadata.

2.10.3.3 Using RWWString in Unicode Applications

Due to platform inconsistencies, Rogue Wave recommends that you do not write Unicode applications with RWWString. On platforms where a wchar_t is defined as greater than 2 bytes, a costly conversion will occur to convert your data from 2-byte UTF-16 to 4-byte padded UTF-16. Furthermore, after the conversion, your application will still not have valid Unicode. Whether the size of wchar_t is 2 bytes or 4 bytes, the RWWString will represent only UTF-16 data, not a true wide string, as it has not been localized. Rogue Wave recommends using one of our Unicode string containers, RWBasicUString (from the Essential Tools Module) or RWUString (from the Internationalization Module).

2.10.3.4 Using RWDBMBString in Unicode Applications

RWDBMBStrings can be bound to Oracle data types NCHAR and NVARCHAR2 only when storing UTF-8 data. There will be an internal conversion to UTF-16 before binding the data.

2.10.4 Data Formats

Date expressions are loaded into the database and extracted from the database in a locale neutral manner. The DB Interface Module properly formats instances of RWDateTime, RWDBDateTime, and RWDate automatically. The application programmer is responsible for formatting these types outside the scope of DB Interface Module API calls.

RWDecimalPortable instances are fully supported.



Previous fileTop of DocumentContentsNo linkNext file

Copyright © Rogue Wave Software, Inc. All Rights Reserved.

The Rogue Wave name and logo, and SourcePro, are registered trademarks of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.