CWCharset


Discussion

This class provides a useful interface for dealing with Internet message character sets.

Superclass

NSObject

Declared In

CWCharset.h



Methods

+allCharsets
-characterIsInCharset:
+charsetForName:
-codeForCharacter:
-initWithCodeCharTable: length:
-initWithCodeCharTable:length:
-name

allCharsets


+ (NSDictionary *) allCharsets; 
Return Value

The dictionary of all supported character sets.

Discussion

This method is used to obtain a dictionary of all supported charsets by Pantomime. The keys are the name of the charsets (NSString instances) and the values are a description of the charset (NSString instances).


characterIsInCharset:


- (BOOL) characterIsInCharset: (unichar) theCharacter; 
Parameters
theCharacter

The Unicode character to verify the availability.

Return Value

YES if it is present, NO otherwise.

Discussion

This method is used to verify if theCharacter is present in the receiver.


charsetForName:


+ (CWCharset *) charsetForName: (NSString *) theName; 
Parameters
theName

The Internet name of a charset, like "iso-8859-1".

Return Value

The CWCharset instance. If a non-supported name was specified, an instance of CWISO8859_1 is returned.

Discussion

This method is used to obtain a CWCharset subclass instance from the Internet name of a charset.


codeForCharacter:


- (int) codeForCharacter: (unichar) theCharacter; 
Parameters
theCharacter

The Unicode character to use.

Return Value

The code from the code table.

Discussion

This method is used to obtain the right code from a Unicode character, in the code table.


initWithCodeCharTable: length:


- (id) initWithCodeCharTable: (const struct charset_code *) codes 
        length: (int) num_codes; 
Parameters
codes

The charset code table which must be sorted by code.

num_codes

The size of the table.

Discussion

This method is used to initialize a CWCharset instance based on the charset code table. You should never call this initializer directly. You should rather invoke directly -init on CWCharset's subclasses.

See Also

initWithCodeCharTable:length:


initWithCodeCharTable:length:


- (id) initWithCodeCharTable: (const struct charset_code *) codes 
        length: (int) num_codes; 
Parameters
codes

The charset code table which must be sorted by code.

num_codes

The size of the table.

Discussion

This method is used to initialize a CWCharset instance based on the charset code table. You should never call this initializer directly. You should rather invoke directly -init on CWCharset's subclasses.

See Also

initWithCodeCharTable: length:


name


- (NSString *) name; 
Return Value

The Internet name of the charset.

Discussion

This method is used to get the name of the receiver. Values returned are like "iso-8859-1", "koi8-r" and so on.


Constants

_codes

_codes


private

const struct charset_code *_codes;

Member Data

_identity_map
_num_codes

_identity_map


private

int _identity_map;

_num_codes


private

int _num_codes;