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



TECInfo

The converter information structure is used by the function TECGetInfo to hold returned information about the Unicode Converter, the Text Encoding Converter, and Basic Text Types.

struct TECInfo {
    UInt16 format;
    UInt16 tecVersion;
    UInt32 tecTextConverterFeatures;
    UInt32 tecUnicodeConverterFeatures;
    UInt32 tecTextCommonFeatures;
    Str31 tecTextEncodingsFolderName;
    Str31 tecExtensionFileName;
/* The following are present if format is >= 2 */
    UInt16  tecLowestTEFileVersion;
    UInt16  tecHighestTEFileVersion;
};
typedef struct TECInfo TECInfo;
typedef TECInfo * TECInfoPtr;
typedef TECInfoPtr * TECInfoHandle;

The following enumerations should be moved to the "Constants" section, and constant descriptions for them need to be added there.

enum {
    kTECInfoCurrentFormat = 2
};
enum {
    kTECKeepInfoFixBit = 0,
    kTECFallbackTextLengthFixBit = 1,
    kTECTextRunBitClearFixBit   = 2,
    kTECTextToUnicodeScanFixBit = 3,
    kTECAddForceASCIIChangesBit = 4,
    kTECPreferredEncodingFixBit = 5,
    kTECAddTextRunHeuristicsBit = 6,
    kTECAddFallbackInterruptBit = 7
};
enum {
    kTECKeepInfoFixMask = 1L << kTECKeepInfoFixBit,
    kTECFallbackTextLengthFixMask   = 1L << kTECFallbackTextLengthFixBit,
    kTECTextRunBitClearFixMask      = 1L << kTECTextRunBitClearFixBit,
    kTECTextToUnicodeScanFixMask    = 1L << kTECTextToUnicodeScanFixBit,
    kTECAddForceASCIIChangesMask    = 1L << kTECAddForceASCIIChangesBit,
    kTECPreferredEncodingFixMask    = 1L << kTECPreferredEncodingFixBit,
    kTECAddTextRunHeuristicsMask    = 1L << kTECAddTextRunHeuristicsBit,
    kTECAddFallbackInterruptMask    = 1L << kTECAddFallbackInterruptBit
};


Field descriptions

format
The current format of the returned structure. The format of the structure is indicated by the kTECInfoCurrentFormat constant. Any future changes to the format will always be backward compatible; any new fields will be added to the end of the structure.

tecVersion
The current version of the Text Encoding Conversion Manager extension in BCD (binary coded decimal), with the first byte indicating the major version; for example, 0x0121 for 1.2.1.

tecTextConverterFeatures
New features or bug fixes in the Text Encoding Converter. No bits are currently defined.

tecUnicodeConverterFeatures

Bit flags indicating new features or bug fixes in the Unicode Converter. The bits currently defined are kTECKeepInfoFixBit, kTECFallbackTextLengthFixBit, kTECTextRunBitClearFixBit, kTECTextToUnicodeScanFixBit, kTecAddForceASCIIChangesBit, kTECPreferredEncodingFixBit; kTECAddTextRunHeuristicsBit, and kTECAddFallbackInterruptBit; the corresponding masks are kTECKeepInfoFixMask, kTECFallbackTextLengthFixMask, kTECTextRunMaskClearFixMask, kTECTextToUnicodeScanFixMask, kTecAddForceASCIIChangesMask, kTECPreferredEncodingFixMask., kTECAddTextRunHeuristicsMask, and kTECAddFallbackInterruptMask.

The kTECKeepInfoFixBit is set if the Unicode Converter has a bug fix to stop ignoring certain control flags if the kUnicodeKeepInfoBit flag is set.

The kTECFallbackTextLengthFixBit is set if the Unicode Converter has a bug fix to use the source length (srcConvLen) and destination length (destConvLen) returned by a caller-supplied fall-back handler for any status it returns except kTECUnmappableElementErr. Previously it honored only these values if noErr was returned.

The kTECTextRunBitClearFixBit is set if ConvertFromUnicodeToTextRun and ConvertFromUnicodeToScriptCodeRun function correctly if the kUnicodeTextRunBit is clear.

The kTECTextToUnicodeScanFixBit is set if ConvertFromTextToUnicode is enhanced so mappings can depend on context and saved state. The consequences of this are (1) malformed input results in kTextMalformedInputErr; (2) ConvertFromTextToUnicode accepts the control flags kUnicodeLooseMappingsMask, kUnicodeKeepInfoMask, and kUnicodeStringUnterminatedMask; (3) elimination of redundant direction overrides when converting Mac OS Arabic and Hebrew to Unicode; and (4) improved mapping of 0x30-0x39 digits in Mac OS Arabic when loose mappings are used.

kTECAddForceASCIIChangesBit is set if the new control flag bits kUnicodeForceASCIIRangeBit and kUnicodeNoHalfwidthCharsBit are supported for use with the functions ConvertFromTextToUnicode, ConvertFromUnicodeToText, and so forth.

kTECPreferredEncodingFixBit is set to indicate that if a preferred encoding is specified for CreateUnicodeToTextRunInfo and related functions, they handle it correctly even if it does not match the system script.

kTECAddTextRunHeuristicsBit is set if the new control flag bit kUnicodeTextRunHeuristicsBit is supported for use with the function ConvertFromUnicodeToTextRun.

kTECAddFallbackInterruptBit is set if the new control flag bit kUnicodeFallbackInterruptSafeMask is supported for use with the functions SetFallbackUnicodeToText and SetFallbackUnicodeToTextRun.

tecTextCommonFeatures
Bit flags indicating new features or bug fixes in Basic Text Types (the Text Common static library). No bits are currently defined.

tecTextEncodingsFolderName
A Pascal string with the (possibly localized) name of the Text Encodings folder.

tecExtensionFileName
A Pascal string with the (possibly localized) name of the Text Encoding Conversion Manager extension file.

tecLowestTEFileVersion
The lowest version number for any file in the Text Encodings folder. This can be compared with the version of the TEC Manager in the tecVersion field.

tecHighestTEFileVersion
The highest version number for any file in the Text Encodings folder. This can be compared with the version of the TEC Manager in the tecVersion field.


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

Up Previous Next