Carbon


GetTextEncodingName

Header: TextCommon.h Carbon status: Supported

Returns the localized name for a specified text encoding.

OSStatus GetTextEncodingName (
    TextEncoding iEncoding, 
    TextEncodingNameSelector iNamePartSelector, 
    RegionCode iPreferredRegion, 
    TextEncoding iPreferredEncoding, 
    ByteCount iOutputBufLen, 
    ByteCount *oNameLength, 
    RegionCode *oActualRegion, 
    TextEncoding *oActualEncoding, 
    TextPtr oEncodingName
);
Parameter descriptions
iEncoding

A text encoding specification whose name you want to obtain.

iNamePartSelector

The portion of the encoding name you want to obtain. See “Text Encoding Name Selectors” for a list of possible values.

iPreferredRegion

The preferred region to use for the name. You can specify a Mac OS region code (which also implies a language) for this parameter. If the function cannot return the name for the preferred region, it returns the name using a region code with the same language or in a default language (for example, English).

iPreferredEncoding

The preferred encoding to use for the name. For example, ASCII, Mac OS Roman, or Shift-JIS. If the function cannot return the name using the preferred encoding, it returns the name using another encoding, such as Unicode or ASCII.

iOutputBufLen

The length in bytes of the output buffer that your application provides for the returned encoding name.

oNameLength

A pointer to a value of type ByteCount. On return, this parameter holds the actual length, in bytes, of the text encoding name. The value represents the full length of the name, which might be greater than the size of the output buffer, specified by the iOutputBufLen parameter. The length of the portion of the name actually contained in the output buffer is the smaller of oNameLength and iOutputBufLen.

oActualRegion

A pointer to a value of type RegionCode. On return, this parameter holds the actual region associated with the returned encoding name.

oActualEncoding

A pointer to a value of type TextEncoding. On return, this parameter holds the actual encoding associated with the returned encoding name.

oEncodingName

A pointer to a buffer you provide. On return, this parameter holds the text encoding name.

function result

A result code.

DISCUSSION

Names returned by GetTextEncodingName (in the buffer referred to by oEncodingName) can contain parentheses and other menu item meta characters, and so cannot be used with AppendMenu or InsertMenuItem. You can use them with SetMenuItemText.

This function can return resources and memory errors, and the following result codes:

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)