SetFallbackUnicodeToTextRun
Specifies a fallback handler to be used for convertinga Unicode text segment to another encoding when the Unicode Convertercannot convert the text using the mapping table specified by a Unicodeconverter object.
Declaration
OSStatus SetFallbackUnicodeToTextRun(UnicodeToTextRunInfo iUnicodeToTextRunInfo, UnicodeToTextFallbackUPP iFallback, OptionBits iControlFlags, LogicalAddress iInfoPtr);Parameters
- iUnicodeToTextRunInfo:
The Unicode converter object to which the fallback handler is to be associated. You use the function 1433632 Createunicodetotextruninfo, 1433651 Createunicodetotextruninfobyenco, or 1433657 Createunicodetotextruninfobyscri to obtain a Unicode converter object to specify for this parameter.
- iFallback:
A universal procedure pointer to the application-defined fallback routine. For a description of the function prototype to which your fallback handler must adhere and how to create your own fallback handler, see Unicodetotextfallbackprocptr. You should use the
NewUnicodeToTextFallbackProcmacro described in the discussion of the function 1433614 Setfallbackunicodetotext. - iControlFlags:
Control flags that stipulate which fallback handler the Unicode Converter should call—the application-defined fallback handler or the default handler—if a fallback handler is required, and the sequence in which the Unicode Converter should call the fallback handlers if either can be used when the other fails or is unavailable. See 1433507 Fallback_handler_selectors.
- iInfoPtr:
A pointer to a block of memory to be passed to the application-defined fallback handler. The Unicode Converter passes this pointer to the application-defined fallback handler as the last parameter when it calls the fallback handler. Your application can use this block to store data required by your fallback handler whenever it is called. This is similar in use to a reference constant(refcon). If you don’t need to use a memory block, specify
NULLfor this parameter.
Return Value
A resultcode. See Result Codes.
Discussion
You can define multiple fallback handlers and associate themwith different Unicode converter objects, depending on your requirements.See UnicodeToTextFallbackProcPtr for adescription of how to create and install an application-definedfallback handler.