KCharsets Class Reference
Charset font and encoder/decoder handling. More...
#include <kcharsets.h>
Public Member Functions | |
virtual | ~KCharsets () |
Destructor. | |
QTextCodec * | codecForName (const QString &name) const |
Provided for compatibility. | |
QTextCodec * | codecForName (const QString &n, bool &ok) const |
Tries to find a QTextCodec to convert the given encoding from and to Unicode. | |
QStringList | availableEncodingNames () |
Lists all available encodings as names. | |
QStringList | descriptiveEncodingNames () |
Lists the available encoding names together with a more descriptive language. | |
QStringList | languages () |
Lists all languages. | |
QStringList | encodingsForLanguage (const QString &language) |
Lists all available encodings for language name 'language'. | |
QString | languageForEncoding (const QString &encoding) |
Returns the language the encoding is used for. | |
QString | encodingForName (const QString &descriptiveName) |
Returns the encoding for a string obtained with descriptiveEncodingNames(). | |
Static Public Member Functions | |
QChar | fromEntity (const QString &str) |
Converts an entity to a character. | |
QChar | fromEntity (const QString &str, int &len) |
Overloaded member function. | |
QString | toEntity (const QChar &ch) |
Converts a QChar to an entity. | |
QString | resolveEntities (const QString &text) |
Scans the given string for entities (like &) and resolves them using fromEntity. | |
Protected Member Functions | |
KCharsets () | |
Protected constructor. | |
Friends | |
class | KGlobal |
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.
- Author:
- Lars Knoll <knoll@kde.org>
- Version:
- Id
- kcharsets.h,v 1.53.2.1 2003/02/09 13:55:28 rnolden Exp
Definition at line 44 of file kcharsets.h.
Constructor & Destructor Documentation
|
Protected constructor. If you need the kcharsets object, use KGlobal::charsets() instead. Definition at line 346 of file kcharsets.cpp. |
|
Destructor.
Definition at line 351 of file kcharsets.cpp. |
Member Function Documentation
|
Provided for compatibility.
Definition at line 517 of file kcharsets.cpp. |
|
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
Definition at line 523 of file kcharsets.cpp. References KLocale::codecForEncoding(), QTextCodec::codecForName(), KGlobal::config(), QString::fromLatin1(), QCString::isEmpty(), QString::isEmpty(), KStdAccel::key(), QString::latin1(), QTextCodec::loadCharmapFile(), KGlobal::locale(), QCString::lower(), QString::lower(), KStdAction::name(), KConfigBase::readPathEntry(), and QCString::upper(). |
|
Converts an entity to a character. The string must contain only the entity without the trailing ';'.
Definition at line 356 of file kcharsets.cpp. References QString::ascii(), QString::length(), QString::toInt(), and QString::unicode(). Referenced by fromEntity(), and resolveEntities(). |
|
Overloaded member function. Tries to find an entity in the QString str.
Definition at line 392 of file kcharsets.cpp. References fromEntity(), and QString::left(). |
|
Converts a QChar to an entity. The returned string does already contain the leading '&' and the trailing ';'.
Definition at line 408 of file kcharsets.cpp. References QString::sprintf(), and QChar::unicode(). |
|
Scans the given string for entities (like &) and resolves them using fromEntity.
Definition at line 415 of file kcharsets.cpp. References KStdAccel::end(), fromEntity(), QChar::isNull(), QString::length(), QString::remove(), and QString::unicode(). |
|
Lists all available encodings as names.
Definition at line 461 of file kcharsets.cpp. References QString::fromLatin1(). Referenced by descriptiveEncodingNames(). |
|
Lists the available encoding names together with a more descriptive language.
Definition at line 505 of file kcharsets.cpp. References availableEncodingNames(), KGlobal::charsets(), languageForEncoding(), and QStringList::sort(). |
|
Lists all languages.
|
|
Lists all available encodings for language name 'language'.
|
|
Returns the language the encoding is used for.
Definition at line 491 of file kcharsets.cpp. References QString::latin1(). Referenced by descriptiveEncodingNames(). |
|
Returns the encoding for a string obtained with descriptiveEncodingNames().
Definition at line 498 of file kcharsets.cpp. References QString::find(), and QString::mid(). |
The documentation for this class was generated from the following files: