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



RevertTextEncodingToScriptInfo

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

pascal OSStatus RevertTextEncodingToScriptInfo (
                     TextEncoding iEncoding,
                     ScriptCode *oTextScriptID,
                     LangCode *oTextLanguageID
                     Str255 oTextFontname);
iEncoding
The text encoding specification to be converted.

oTextScriptID
A pointer to a value of type ScriptCode. On output, 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 on input, the function returns a paramErr result code.

oTextLanguageID
A pointer to a value of type LangCode. On input, to indicate that you do not want the function to return the language code, specify NULL as the value of this parameter. On output, 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, to indicate that you do not want the function to return the font name, specify NULL as the value of this parameter. On output, 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. 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 Text Encoding Conversion Manager Result Codes .

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.

SEE ALSO

The function UpgradeScriptInfoToTextEncoding

Text Encoding Base


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

Up Previous Next