Carbon


RevertTextEncodingToScriptInfo

Header: TextCommon.h Carbon status: Supported

Converts the given Mac OS text encoding specification to the corresponding script code and, if possible, language code and font name.

OSStatus RevertTextEncodingToScriptInfo (
    TextEncoding iEncoding, 
    ScriptCode *oTextScriptID, 
    LangCode *oTextLanguageID, 
    Str255 oTextFontname
);
Parameter descriptions
iEncoding

The text encoding specification to be converted.

oTextScriptID

A pointer to a value of type ScriptCode. On return, a Mac OS script code that corresponds to the text encoding specification you identified in the iEncoding parameter. If you do not pass a pointer for this parameter, the function returns a paramErr result code.

oTextLanguageID

A pointer to a value of type LangCode. On input, if you do not want the function to return the language code, specify NULL as the value of this parameter. On return, the appropriate language code, if the language can be unambiguously derived from the text encoding specification, for example, Japanese, and you did not set the parameter to NULL.

If you do not specify NULL on input and the language is ambiguous—that is, the function cannot accurately derive it from the text encoding specification—the function returns a value of kTextLanguageDontCare.

oTextFontname

A Pascal string. On input, if you do not want the function to return the font name, specify NULL as the value of this parameter. On return, the name of the appropriate font if the font can be unambiguously derived from the text encoding specification, for example, Symbol, and you did not set the parameter to NULL.

If you do not specify NULL on input and the font is ambiguous—that is, the function cannot accurately derive it from the text encoding specification—the function returns a zero-length string.

function result

A result code. A result code. The function returns paramErr if the text encoding specification input parameter value is invalid. The function returns a kTECTableFormatErr result code if the internal mapping tables used for translation are invalid. For a list of other possible result codes, see “Data Types”.

DISCUSSION

If you have applications that use Mac OS Script Manager and Font Manager functions, you can use the RevertTextEncodingToScriptInfo function to convert information in a text encoding specification into the appropriate Mac OS script code, language code, and font name, if they can be unambiguously derived. Your application can then use this information to display text to a user on the screen.

For more information see the UpgradeScriptInfoToTextEncoding function and “Base Text Encodings”.

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)