Functions


Converting Between Script Manager Values and Text Encodings

RevertTextEncodingToScriptInfo Converts the given Mac OS text encoding specification to the corresponding script code and, if possible, language code and font name.
UpgradeScriptInfoToTextEncoding Converts any combination of a Mac OS script code, a language code, a region code, and a font name to a text encoding.

Converting Between Unicode and Pascal Strings

ConvertFromPStringToUnicode Converts a Pascal string in a Mac OS text encoding to a Unicode string.
ConvertFromUnicodeToPString Converts a Unicode string to Pascal in a Mac OS text encoding.

Converting From Unicode to Multiple Encodings

ConvertFromUnicodeToScriptCodeRun Converts a string from Unicode to one or more scripts.
ConvertFromUnicodeToTextRun Converts a string from Unicode to one or more encodings.
CreateUnicodeToTextRunInfo Creates and returns a Unicode converter object containing the information required for converting a Unicode text string to strings in one or more non-Unicode encodings.
CreateUnicodeToTextRunInfoByEncoding Based on the given text encoding specifications for the converted text runs, creates and returns a Unicode converter object containing information required for converting strings from Unicode to one or more specified non-Unicode encodings.
CreateUnicodeToTextRunInfoByScriptCode Based on the given script codes for the converted text runs, creates and returns a Unicode converter object containing information required for converting strings from Unicode to one or more specified non-Unicode encodings.
DisposeUnicodeToTextRunInfo Releases the memory allocated for the specified Unicode converter object.

Converting From Unicode

ChangeUnicodeToTextInfo Changes the mapping information contained in the specified Unicode converter object used to convert Unicode text to a non-Unicode encoding.
ConvertFromUnicodeToText Converts a Unicode text string to the destination encoding you specify.
CreateUnicodeToTextInfo Creates and returns a Unicode converter object containing information required for converting strings from Unicode to a non-Unicode encoding.
CreateUnicodeToTextInfoByEncoding Based on the given text encoding specification for the converted text, creates and returns a Unicode converter object containing information required for converting strings from Unicode to the specified non-Unicode encoding.
DisposeUnicodeToTextInfo Releases the memory allocated for the specified Unicode converter object.

Converting Text Between Encodings

TECConvertText Converts a stream of text from a source encoding to a destination encoding. It uses the conversion path specified by the converter object you supply.
TECFlushText Flushes out any data in a converter object’s temporary buffers and resets the converter object.

Converting to Multiple Encoding Runs

TECConvertTextToMultipleEncodings Converts text in the source encoding to runs of text in multiple destination encodings. It uses the conversion path specified in the converter object you supply.
TECCreateOneToManyConverter Determines a conversion path for the source encoding and destinations encodings you specify, creates a text encoding converter object, and returns a reference to it.
TECCreateOneToManyConverterFromPath This function is obsolete and no longer supported.
TECFlushMultipleEncodings Flushes out any encodings that may be stored in a converter object’s temporary buffers and shifts encodings back to their default state, if any.
TECGetEncodingList Gets the list of destination encodings from a converter object created by TECCreateOneToManyConverter. It returns the number of destination encodings and a pointer to an array of text encoding specifications.

Converting to Unicode

ChangeTextToUnicodeInfo Changes the mapping information for the specified Unicode converter object used to convert text to Unicode to the new mapping you provide.
ConvertFromTextToUnicode Converts a string from any encoding to Unicode.
CreateTextToUnicodeInfo Creates and returns a Unicode converter object containing information required for converting strings from a non-Unicode encoding to Unicode.
CreateTextToUnicodeInfoByEncoding Based on the given text encoding specification, creates and returns a Unicode converter object containing information required for converting strings from the specified non-Unicode encoding to Unicode.
DisposeTextToUnicodeInfo Releases the memory allocated for the specified Unicode converter object.

Creating a Text Encoding Specification

CreateTextEncoding Creates and returns a text encoding specification.

Creating and Deleting Converter objects

TECClearConverterContextInfo Resets a converter object to its initial state so you can reuse it.
TECCreateConverter Determines a conversion path for a source and destination encoding, then creates a text encoding converter object and returns a pointer to it.
TECCreateConverterFromPath Creates a converter object for a specific conversion path—from a source encoding through intermediate encodings to a destination encoding—and returns a pointer to it.
TECDisposeConverter Disposes of a converter object.

Getting Information About Internet and Regional Text Encoding Names

TECCountMailTextEncodings Counts and returns the number of currently supported e-mail encodings for a specified region.
TECCountWebTextEncodings Counts and returns the number of currently supported text encodings for a region code.
TECGetMailTextEncodings Returns the currently supported mail encoding specifications for a region code.
TECGetTextEncodingFromInternetName Returns the Mac OS text encoding specification that corresponds to an Internet encoding name.
TECGetTextEncodingInternetName Returns the Internet encoding name that corresponds to a Mac OS text encoding.
TECGetWebTextEncodings Returns the currently supported text encoding specifications for a region code.

Identifying Direct Encoding Conversions

TECCountDirectTextEncodingConversions Counts and returns the number of direct conversions currently configured in the Text Encoding Converter.
TECGetDirectTextEncodingConversions Returns the types of direct conversions currently configured in the Text Encoding Converter.

Identifying Possible Destination Encodings

TECCountDestinationTextEncodings Counts and returns the number of destination encodings to which a specified source encoding can be converted in one step.
TECGetDestinationTextEncodings Returns the encoding specifications for all the destination text encodings to which the Text Encoding Converter can directly convert the specified source encoding.

Obtaining Converter Information

TECGetInfo Allocates a converter information structure of type TECInfo in the application heap using NewHandle, fills it out, and returns a handle.

Obtaining Information About Available Text Encodings

TECCountAvailableTextEncodings Counts and returns the number of text encodings currently configured in the Text Encoding Converter.
TECCountSubTextEncodings Counts and returns the number of subencodings a text encoding supports.
TECGetAvailableTextEncodings Returns the text encoding specifications currently configured in the Text Encoding Converter.
TECGetSubTextEncodings Returns the text encoding specifications for the subencodings the encoding scheme supports.

Obtaining Information From a Text Encoding Specification

GetTextEncodingBase Returns the base encoding of the specified text encoding.
GetTextEncodingFormat Returns the format value of the specified text encoding.
GetTextEncodingName Returns the localized name for a specified text encoding.
GetTextEncodingVariant Returns the variant from the specified text encoding.
ResolveDefaultTextEncoding Returns a text encoding specification in which any meta-values have been resolved to real values. Currently, this affects only the base encoding values packed into the text encoding specification.

Obtaining Mapping Information

CountUnicodeMappings Counts available mappings that meet the specified matching criteria.
QueryUnicodeMappings Returns a list of the conversion mappings available on the system that meet specified matching criteria and returns the number of mappings found.

Setting the Fallback Handler

SetFallbackUnicodeToText 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.
SetFallbackUnicodeToTextRun 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 function ConvertFromUnicodeToText, ConvertFromUnicodeToTextRun, ConvertFromUnicodeToPString, or ConvertFromUnicodeToScriptCodeRun.

Truncating Strings Before Converting Them

TruncateForTextToUnicode Identifies where your application can safely break a multibyte string to be converted to Unicode so that the string is not broken in the middle of a multibyte character.
TruncateForUnicodeToText Identifies where your application can safely break a Unicode string to be converted to any encoding so that the string is broken in a way that preserves the text element integrity.

Using Sniffers to Investigate Encodings

TECClearSnifferContextInfo Resets a sniffer object to its initial settings so you can reuse it.
TECCountAvailableSniffers Counts and returns the number of sniffers available in all installed plug-ins.
TECCreateSniffer Creates a sniffer object and returns a reference to it.
TECDisposeSniffer Disposes of a sniffer object.
TECGetAvailableSniffers Returns the list of sniffers available in all installed plug-ins.
TECSniffTextEncoding Analyzes a text stream and returns the probable encodings in a ranked list, based on an array of possible encodings you supply. It also returns the number of errors and features for each encoding.

Using a Static Library

InitializeUnicodeConverter Initializes the 68K static library version of the Unicode Converter.
TerminateUnicodeConverter Terminates the 68K static library version of the Unicode Converter.

Miscellaneous

CallUnicodeToTextFallbackProc
DisposeUnicodeToTextFallbackUPP
InitializeUnicode
InvokeUnicodeToTextFallbackUPP
NearestMacTextEncodings
NewUnicodeToTextFallbackUPP
ResetTextToUnicodeInfo
ResetUnicodeToTextInfo
ResetUnicodeToTextRunInfo
TECSetBasicOptions
TerminateUnicode
UCGetCharProperty

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