class KCharsets

Charset font and encoder/decoder handling. More...

Definition#include <kcharsets.h>
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Public Static Methods

Protected Methods


Detailed Description

Charset font and encoder/decoder handling.

This is needed, because Qt's font matching algorithm gives the font family a higher priority than the charset. For many applications this is not acceptable, since it can totally obscure the output, in languages which use non iso-8859-1 charsets.

 KCharsets ()

KCharsets

[protected]

Protected constructor. If you need the kcharsets object, use KGlobal::charsets() instead.

 ~KCharsets ()

~KCharsets

[virtual]

Destructor.

QTextCodeccodecForName (const QString &name)

codecForName

[const]

Provided for compatibility.

Parameters:
namethe name of the codec

Returns: the QTextCodec. If the desired codec could not be found, it returns a default (Latin-1) codec

QTextCodeccodecForName (const QString &n, bool &ok)

codecForName

[const]

Tries to find a QTextCodec to convert the given encoding from and to Unicode. If no codec could be found the latin1 codec will be returned an ok will be set to false.

Returns: the QTextCodec. If the desired codec could not be found, it returns a default (Latin-1) codec

QChar  fromEntity (const QString &str)

fromEntity

[static]

Converts an entity to a character. The string must contain only the entity without the trailing ';'.

Parameters:
strthe entity

Returns: QChar::null if the entity could not be decoded.

QChar  fromEntity (const QString &str, int &len)

fromEntity

[static]

Overloaded member function. Tries to find an entity in the QString str.

Parameters:
strthe string containing entified
lenis a return value, that gives the length of the decoded entity.

Returns: a decoded entity if one could be found, QChar::null otherwise

QString  toEntity (const QChar &ch)

toEntity

[static]

Converts a QChar to an entity. The returned string does already contain the leading '&' and the trailing ';'.

Parameters:
chthe char to convert

Returns: the entity

QString  resolveEntities ( const QString &text )

resolveEntities

[static]

Scans the given string for entities (like &amp;) and resolves them using fromEntity.

Parameters:
textthe string containing the entities

Returns: the clean string

QStringList  availableEncodingNames ()

availableEncodingNames

Lists all available encodings as names.

Returns: the list of all encodings

QStringList  descriptiveEncodingNames ()

descriptiveEncodingNames

Lists the available encoding names together with a more descriptive language.

Returns: the list of descriptive encoding names

QStringList  languages ()

languages

Lists all languages.

Returns: a list of all languages

QStringList  encodingsForLanguage ( const QString &language )

encodingsForLanguage

Lists all available encodings for language name 'language'.

Parameters:
languageto language to search for

Returns: the list of encodings for the language

QString  languageForEncoding ( const QString &encoding )

languageForEncoding

Returns the language the encoding is used for.

Parameters:
encodingthe encoding for the language

Returns: the language of the encoding

QString  encodingForName ( const QString &descriptiveName )

encodingForName

Returns the encoding for a string obtained with descriptiveEncodingNames().

Parameters:
thedescriptive name for the encoding

Returns: the name of the encoding