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



TECCountSubTextEncodings

Counts and returns the number of subencodings a text encoding supports.

pascal OSStatus TECCountSubTextEncodings (
TextEncoding inputEncoding, ItemCount *numberEncodings);

inputEncoding
The text encoding specification containing the subencodings.

numberEncodings
A pointer to a value of type ItemCount. On output, this value indicates the number of currently supported subencodings.

function result
A result code. See Text Encoding Conversion Manager Result Codes for a list of possible values. If other than noErr, then one of the text conversion plug-ins encountered an error when polled by the Text Encoding Converter.

DISCUSSION

The TECCountSubTextEncodings function counts and returns the number of subencodings that you can use to perform conversions based on the current configuration of the Text Encoding Converter. Subencodings are text encodings that are embedded as part of a larger text encoding specification. For example, EUC-JP contains JIS Roman or ASCII, JIS X0208, JIS X0212, and half-width Katakana from JIS X0201. Not every encoding that can be broken into multiple encodings necessarily supports this routine. It's up to the plug-in developer to decide which encodings might be useful to break up. Subencodings are not the same as text encoding variants.

The numberEncodings value returned tells you what size array you must allocate in a parameter of the function TECGetSubTextEncodings. Therefore, you should call this function before you call TECGetSubTextEncodings in order to accommodate the specifications for all of these text encodings.

If an encoding can be converted to multiple runs of encodings (as indicated by a destination base encoding of kTextEncodingMultiRun), you can call the function TECGetSubTextEncodings to get the list of output encodings. See the descriptions of the TECCreateOneToManyConverter and TECGetDestinationTextEncodings for information about multiple output encoding run conversions.


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

Up Previous Next