To support various character encodings, the Secure Messaging SDK provides an interface to support up to four different encodings at the same time. The configuration that is applied to the client must match the one applied to the server.
UTF-8 character encoding in Unicode Basic Multilingual Plane
The SDK supports UTF-8 encoding of characters in the Unicode Basic Multilingual Plane (BMP), allowing formatted text fields to carry any character from the Unicode Basic Multilingual Plane (accented Latin, €, Cyrillic, CJK etc.) in transaction, challenge, and free-text messages. When a message is received that uses UTF-8 BMP encoding, the SDK surfaces the text through the existing FormattedText APIs. The SDK validates the encoding type in the message header. If a message specifies an encoding type other than the legacy encoding or UTF-8 BMP, the SDK returns unsupportedMessageEncoding (-4868).
For this feature to be operational, both the server and client must map the UTF-8 BMP font table into one of the four slots with setCustomFontTablesIndexes(...). If the table is not mapped, the server fails with a font-table-index error.
Message capacity is lower. The body limit is still 1024 hex characters, which is max. 512 bytes in UTF-8. How many characters effectively fit into the message depends on the characters used:
ASCII: 512 characters
Latin: 256 accented characters
CJK characters or €: 170
For comparison: with Cronto encoding, the same limit holds about 768 characters. We recommend checking message length when switching between encodings.
The mapping is static and applies to the entire process.
For more information about integrating font tables, see Integrate the Secure Messaging SDK Server Font Tables.
API reference documentation and sample applications
To learn more about the public APIs and their functions, exceptions, and error codes, refer to the technical documentation that is included in the product package for each SDK and each platform. In the product package, you can also find the sample applications provided for each platform to see examples of how the SDKs can be used.
These sample apps are intended only to demonstrate basic scenarios and SDK usage. They are not designed to be copied directly into production projects!