KCharsets Class Reference
Charset font and encoder/decoder handling. More...
#include <kcharsets.h>
Public Member Functions | |
virtual | ~KCharsets () |
QTextCodec * | codecForName (const QString &name) const |
QTextCodec * | codecForName (const QString &n, bool &ok) const |
QStringList | availableEncodingNames () |
QStringList | descriptiveEncodingNames () |
QString | languageForEncoding (const QString &encoding) |
QString | encodingForName (const QString &descriptiveName) |
Static Public Member Functions | |
QChar | fromEntity (const QString &str) |
QChar | fromEntity (const QString &str, int &len) |
QString | toEntity (const QChar &ch) |
QString | resolveEntities (const QString &text) |
Protected Member Functions | |
KCharsets () |
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.57 2003/10/06 07:45:39 bhards 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.
|
|
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
References KLocale::codecForEncoding(), QTextCodec::codecForName(), KGlobal::config(), QCString::isEmpty(), QString::isEmpty(), QString::latin1(), QTextCodec::loadCharmapFile(), KGlobal::locale(), QCString::lower(), QString::lower(), KConfigBase::readPathEntry(), and QCString::upper(). |
|
Converts an entity to a character. The string must contain only the entity without the trailing ';'.
References QString::ascii(), QString::length(), and QString::unicode(). Referenced by fromEntity(), and resolveEntities(). |
|
Overloaded member function. Tries to find an entity in the QString str.
References fromEntity(), and QString::left(). |
|
Converts a QChar to an entity. The returned string does already contain the leading '&' and the trailing ';'.
References QString::sprintf(), and QChar::unicode(). |
|
Scans the given string for entities (like &) and resolves them using fromEntity.
References fromEntity(), QChar::isNull(), QString::length(), QString::remove(), and QString::unicode(). |
|
Lists all available encodings as names.
Referenced by descriptiveEncodingNames(). |
|
Lists the available encoding names together with a more descriptive language.
References QString::arg(), availableEncodingNames(), KGlobal::charsets(), languageForEncoding(), and QStringList::sort(). |
|
Returns the language the encoding is used for.
References QString::latin1(). Referenced by descriptiveEncodingNames(). |
|
Returns the encoding for a string obtained with descriptiveEncodingNames().
References QString::findRev(), QString::mid(), and QString::stripWhiteSpace(). |
The documentation for this class was generated from the following files: