Carbon


SetFallbackUnicodeToText

Header: UnicodeConverter.h Carbon status: Supported

Specifies 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.

OSStatus SetFallbackUnicodeToText (
    UnicodeToTextInfo iUnicodeToTextInfo, 
    UnicodeToTextFallbackUPP iFallback, 
    OptionBits iControlFlags, 
    LogicalAddress iInfoPtr
);
Parameter descriptions
iUnicodeToTextInfo

\The Unicode converter object to which the fallback handler is to be associated. You use the function CreateUnicodeToTextInfo or CreateUnicodeToTextInfoByEncoding to obtain a Unicode converter object of this type.

iFallback

A universal procedure pointer to the application-defined fallback routine. For a description of the function prototype that your fallback handler must adhere to and how to create your own fallback handler, see UnicodeToTextFallbackProcPtr. You should use the NewUnicodeToTextFallbackProc macro to convert a pointer to your fallback handler into a UnicodeToTextFallbackUPP.

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 “Fallback-Handler Controls”.

iInfoPtr

A point 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 memory 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 NULL for this parameter.

function result

A result code.

DISCUSSION

You can define multiple fallback handlers and associate them with different Unicode converter objects, depending on your requirements. See UnicodeToTextFallbackProcPtr for a description of how to create and install an application-defined fallback handler.

You can use a fallback handler when one of the Unicode conversion functions, ConvertFromUnicodeToText, ConvertFromUnicodeToTextRun, ConvertFromUnicodeToPString, and ConvertFromUnicodeToScriptCodeRun, cannot convert the text using the mapping table specified by the Unicode converter object passed to the function.

AVAILABILITY

Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.


© 2000 Apple Computer, Inc. (Last Updated 7/17/2000)