Unicode Field Types
- The Unicode field types allow data to be handled as Unicode throughout an RDMLX application, in the UI and in the database. This means an application can allow data from multiple languages to be displayed and edited, saved in/read from the same database table, or sent to and received from external servers, all without data loss.
- Existing Alpha, Char, and String fields may be changed to Nchar or Nvarchar to enable your existing application to support world-wide multilingual customer data (such as names and addresses) as well as language-specific descriptions for code tables and many other situations.
- Nchar and Nvarchar are supported across LANSA products such as LANSA Integrator, LANSA Client and LANSA Open for .NET.
- Nchar and Nvarchar are handled differently from Char and String with the SUNI attribute. The SUNI attribute indicates that the field is Unicode in the database layer only. Elsewhere, it is handled in the current code page, which means that if you assign an Nchar to a Char with SUNI, data loss may occur unless all data is known to be in the current code page. The use of the SUNI attribute is not recommended.
The following Intrinsic Functions are particularly useful when developing with Unicode Field Types:
Intrinsic Function | Notes |
|---|
AsNativeString | Use this function to convert Nchar or Nvarchar data to the current code page when Unicode Field Types are not supported. For example, when invoking a BIF that doesn't support Unicode. Characters not supported in the current code page are changed to ?. |
AsUnicodeString | Use this function to populate an Nchar or Nvarchar from the numeric value (code point) of the character. It converts a decimal whole number to an individual Unicode character – these can be concatenated to construct a Unicode string that may not be possible to represent in the current code page. |
AsCodePoint | Use this function to deconstruct an Nchar into its individual characters as numeric values. This function is the opposite of AsUnicodeString. It takes an Nchar character and returns the numeric value (code point) of the character. |