Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Up Previous Next 

PATH 
Mac OS 8 and 9 Developer Documentation > Text Encoding Conversion Manager
Programming With the Text Encoding Conversion Manager



Fallback-Handler Control Flags

A fallback mapping is a sequence of one or more characters in the destination encoding that are not exactly equivalent to the source characters but which preserve some of the information of the original. For example, (C) is a possible fallback mapping for ©.

A fallback handler is a function that the Unicode Converter uses to perform fallback mapping. The Unicode Converter supplies a default fallback handler. You can provide your own fallback handler and use it alone, or you can use both. Using fallback control flags, described in Fallback-Handler Control Flags , you can specify the order in which both handlers are called if one fails.

You set a control flag value to specify which fallback handler the Unicode Converter should use, and--if both are to be used--to specify the order in which they are called. You can also set a control flag to specify that your fallback handler does not make any calls that could move memory. If it does not move memory, functions such as ConvertFromUnicodeToText can avoid locking some relocatable objects, thus improving performance.

The following enumeration defines constants for the setting the controlFlags parameter of the functions SetFallbackUnicodeToText and SetFallbackUnicodeToTextRun.

enum {
    /* You must use exactly one of the following: */
    kUnicodeFallbackDefaultOnly = 0L,
    kUnicodeFallbackCustomOnly = 1L,
    kUnicodeFallbackDefaultFirst = 2L,
    kUnicodeFallbackCustomFirst = 3L,
    /* You may also OR in any of the following: */
    kUnicodeFallbackInterruptSafeMask = 1L << 2
};

Constant descriptions

kUnicodeFallbackDefaultOnly
Use the default fallback handler only.

kUnicodeFallbackCustomOnly
Use the custom fallback handler only.

kUnicodeFallbackDefaultFirst
Use the default fallback handler first, then the custom one.

kUnicodeFallbackCustomFirst
Use the custom fallback handler first, then the default one.

kUnicodeFallbackInterruptSafeMask
You can use this mask to set a control flags bit that indicates that your custom fallback handler does not move memory.


© 1999 Apple Computer, Inc. – (Last Updated 13 Dec 99)

Up Previous Next