Important: The information in this document is obsolete and should not be used for new development.
Associates an application-defined fallback handler with a specific UnicodeToTextInfo Unicode converter object for a single text run to be used with either the function ConvertFromUnicodeToText or ConvertFromUnicodeToPString.
pascal OSStatus SetFallbackUnicodeToText (
You use this function to specify a fallback handler to be used for converting a Unicode text segment to another encoding when the Unicode Converter cannot convert the text using the mapping table specified by the Unicode converter object passed to the functions ConvertFromUnicodeToText, ConvertFromUnicodeToTextRun, ConvertFromUnicodeToPString, and ConvertFromUnicodeToScriptCodeRun. You can define multiple fallback handlers and associate them with different Unicode converter objects, depending on your requirements.
The following example shows how to install an application-defined fallback handler. You can name your application-defined fallback handler anything you choose. The name, MyUnicodeToTextFallbackProc, used in this example is not significant. However, you must adhere to the parameters, the return type, and the calling convention as expressed in this example, which follows the prototype, because a pointer to this function must be of type UnicodeToTextFallbackProcPtr as defined in the UnicodeConverter.h header file.
The UnicodeConverter.h header file also defines the UnicodeToTextFallbackUPP type and the NewUnicodeToTextFallbackProc macro. See Application-Defined Function for a description of the parameters of an application-defined fallback handler.
Listing 4-1 Installing an Application-Defined Fallback Handler
#include <Types.h>