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



NearestMacTextEncodings

Finds Mac OS encodings which have a character repertoire closest to that of an arbitrary non-Unicode encoding.

pascal OSStatus NearestMacTextEncodings(
                     TextEncoding generalEncoding,
                     TextEncoding *bestMacEncoding,
                     TextEncoding *alternateMacEncoding);
generalEncoding
A TextEncoding specifying an arbitrary non-Unicode encoding.

bestMacEncoding
A pointer to a variable of type TextEncoding. On output, this variable indicates the Mac OS encoding with the closest repertoire match to generalEncoding. If there is no appropriate Mac OS encoding, this variable contains kTextEncodingUnknown (0xFFFF).

alternateMacEncoding
A pointer to a variable of type TextEncoding. On output, this variable indicates a Mac encoding that may be more generally available but may not have as good a match (e.g. if bestMacEncoding specifies Mac OS VT100, alternateMacEncoding might specify Mac OS Roman). If there is no appropriate Mac OS encoding, this variable contains kTextEncodingUnknown (0xFFFF). You can pass NULL for alternateMacEncoding if you do not need the alternate encoding information.

function result
A result code. The function returns paramErr if generalEncoding is a Unicode encoding or if bestMacEncoding is NULL. It returns kTextUnsupportedEncodingErr if it does not support generalEncoding. For more serious errors, it may return kTECGlobalsUnavailableErr, kTECMissingTableErr, or Resource or Memory Manager errors.

DISCUSSION

When converting text from the Internet or from other platforms to Mac OS encodings (for display on the Mac OS, for example), you may need to know which Mac OS encodings provide the best match--that is, which Mac OS encodings have a character repertoire which is closest to that of an arbitrary non-Unicode encoding.

VERSION NOTES
Introduced with Text Encoding Conversion Manager 1.5.


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

Up Previous Next