Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 2 Designing and Implementing Custom Adapters : Internationalization

Internationalization
Both C++ APIs and Java APIs support Unicode for application data. This allows custom adapters to work with Unicode strings programmatically and to send and receive data between applications that use a variety of supported encodings. The data can be aggregated and serialized, and then sent over the network.
The Java Adapter SDK takes advantage of native Java Unicode support.
The C++ Adapter SDK includes classes to encapsulate Unicode data. Their constructors allow you to specify the encoding for the source data. A complete list of supported encodings can be found in the TIBCO Adapter SDK Programmer’s Guide.
SDK-Internal C++ Unicode Type Conversion
Internally, the C++ SDK first decides to use one of two native implementations: Latin-1 for single-byte characters or UTF-16 for double-byte characters.
Whether the SDK attempts conversion, and what conversion the SDK attempts depends on the encoding argument presented to the constructor for MChar or MStringData.
If the encoding presented to the constructor is ASCII, Latin-1, or UTF-16, no conversion is needed. For all other cases, the SDK attempts a best-case conversion. If conversion is required (for example, UTF-16 to Latin-1), a replacement character is used for unmappable characters.
For Unicode conversion, the environment variable TIB_ICU_DATA must point to the directory that contains the file named tibicudata.dat, which provides a lookup table for conversion. If the SDK cannot find this file, it will throw an exception when you attempt to convert certain types of string encodings.
Specifying the Wire Format Encoding
The wire format encoding for messages affects communications for adapter applications. TIBCO Administrator supports either Latin-1 or UTF-8 as its wire format encoding when the adapter application is using a server-based repository.
If the project uses only ASCII or Latin-1 data, you can set the encoding to be Latin-1. This encoding makes the custom adapter run faster. Otherwise, use UTF-8.

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved