.TH "KCharsets" kde3 "11 Jun 2005" "Version Version 3.4.1" "kdecore Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KCharsets \- Charset font and encoder/decoder handling.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kcharsets.h>\fP
.PP
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "virtual \fB~KCharsets\fP ()"
.br
.ti -1c
.RI "\fBQTextCodec\fP * \fBcodecForName\fP (const \fBQString\fP &name) const "
.br
.ti -1c
.RI "\fBQTextCodec\fP * \fBcodecForName\fP (const \fBQString\fP &n, bool &ok) const "
.br
.ti -1c
.RI "\fBQStringList\fP \fBavailableEncodingNames\fP ()"
.br
.ti -1c
.RI "\fBQStringList\fP \fBdescriptiveEncodingNames\fP ()"
.br
.ti -1c
.RI "\fBQString\fP \fBlanguageForEncoding\fP (const \fBQString\fP &encoding)"
.br
.ti -1c
.RI "\fBQString\fP \fBencodingForName\fP (const \fBQString\fP &descriptiveName)"
.br
.in -1c
.SS "Static Public Member Functions"

.in +1c
.ti -1c
.RI "static \fBQChar\fP \fBfromEntity\fP (const \fBQString\fP &str)"
.br
.ti -1c
.RI "static \fBQChar\fP \fBfromEntity\fP (const \fBQString\fP &str, int &len)"
.br
.ti -1c
.RI "static \fBQString\fP \fBtoEntity\fP (const \fBQChar\fP &ch)"
.br
.ti -1c
.RI "static \fBQString\fP \fBresolveEntities\fP (const \fBQString\fP &text)"
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "\fBKCharsets\fP ()"
.br
.in -1c
.SS "Friends"

.in +1c
.ti -1c
.RI "class \fBKGlobal\fP"
.br
.in -1c
.SH "Detailed Description"
.PP 
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.
.PP
\fBAuthor:\fP
.RS 4
Lars Knoll <knoll@kde.org> 
.RE
.PP

.PP
Definition at line 43 of file kcharsets.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KCharsets::KCharsets ()\fC [protected]\fP"
.PP
Protected constructor. 
.PP
If you need the kcharsets object, use \fBKGlobal::charsets()\fP instead. 
.PP
Definition at line 372 of file kcharsets.cpp.
.SS "KCharsets::~\fBKCharsets\fP ()\fC [virtual]\fP"
.PP
Destructor. 
.PP
Definition at line 377 of file kcharsets.cpp.
.SH "Member Function Documentation"
.PP 
.SS "\fBQTextCodec\fP * KCharsets::codecForName (const \fBQString\fP & name) const"
.PP
Provided for compatibility. 
.PP
\fBParameters:\fP
.RS 4
\fIname\fP the name of the codec 
.RE
.PP
\fBReturns:\fP
.RS 4
the \fBQTextCodec\fP. If the desired codec could not be found, it returns a default (Latin-1) codec 
.RE
.PP

.PP
Definition at line 553 of file kcharsets.cpp.
.SS "\fBQTextCodec\fP * KCharsets::codecForName (const \fBQString\fP & n, bool & ok) const"
.PP
Tries to find a \fBQTextCodec\fP to convert the given encoding from and to Unicode. 
.PP
If no codec could be found the latin1 codec will be returned an \fCok\fP will be set to false. 
.PP
\fBReturns:\fP
.RS 4
the \fBQTextCodec\fP. If the desired codec could not be found, it returns a default (Latin-1) codec 
.RE
.PP

.PP
Definition at line 559 of file kcharsets.cpp.
.PP
References KLocale::codecForEncoding(), QTextCodec::codecForName(), KGlobal::config(), QCString::isEmpty(), QCString::length(), QTextCodec::loadCharmapFile(), KGlobal::locale(), QCString::lower(), KConfigBase::readPathEntry(), QCString::right(), QCString::truncate(), and QCString::upper().
.SS "\fBQChar\fP KCharsets::fromEntity (const \fBQString\fP & str)\fC [static]\fP"
.PP
Converts an entity to a character. 
.PP
The string must contain only the entity without the trailing ';'. 
.PP
\fBParameters:\fP
.RS 4
\fIstr\fP the entity 
.RE
.PP
\fBReturns:\fP
.RS 4
QChar::null if the entity could not be decoded. 
.RE
.PP

.PP
Definition at line 382 of file kcharsets.cpp.
.PP
Referenced by fromEntity(), and resolveEntities().
.SS "\fBQChar\fP KCharsets::fromEntity (const \fBQString\fP & str, int & len)\fC [static]\fP"
.PP
Overloaded member function. 
.PP
Tries to find an entity in the \fBQString\fP str. 
.PP
\fBParameters:\fP
.RS 4
\fIstr\fP the string containing entified 
.br
\fIlen\fP is a return value, that gives the length of the decoded entity. 
.RE
.PP
\fBReturns:\fP
.RS 4
a decoded entity if one could be found, QChar::null otherwise 
.RE
.PP

.PP
Definition at line 418 of file kcharsets.cpp.
.PP
References fromEntity().
.SS "\fBQString\fP KCharsets::toEntity (const \fBQChar\fP & ch)\fC [static]\fP"
.PP
Converts a \fBQChar\fP to an entity. 
.PP
The returned string does already contain the leading '&' and the trailing ';'. 
.PP
\fBParameters:\fP
.RS 4
\fIch\fP the char to convert 
.RE
.PP
\fBReturns:\fP
.RS 4
the entity 
.RE
.PP

.PP
Definition at line 434 of file kcharsets.cpp.
.PP
References QString::sprintf().
.SS "\fBQString\fP KCharsets::resolveEntities (const \fBQString\fP & text)\fC [static]\fP"
.PP
Scans the given string for entities (like &amp;) and resolves them using fromEntity. 
.PP
\fBParameters:\fP
.RS 4
\fItext\fP the string containing the entities 
.RE
.PP
\fBReturns:\fP
.RS 4
the clean string 
.RE
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP

.PP
Definition at line 441 of file kcharsets.cpp.
.PP
References fromEntity(), QChar::isNull(), QString::length(), QString::remove(), and QString::unicode().
.SS "\fBQStringList\fP KCharsets::availableEncodingNames ()"
.PP
Lists all available encodings as names. 
.PP
\fBReturns:\fP
.RS 4
the list of all encodings 
.RE
.PP

.PP
Definition at line 487 of file kcharsets.cpp.
.PP
Referenced by descriptiveEncodingNames().
.SS "\fBQStringList\fP KCharsets::descriptiveEncodingNames ()"
.PP
Lists the available encoding names together with a more descriptive language. 
.PP
\fBReturns:\fP
.RS 4
the list of descriptive encoding names 
.RE
.PP

.PP
Definition at line 541 of file kcharsets.cpp.
.PP
References QString::arg(), availableEncodingNames(), KGlobal::charsets(), languageForEncoding(), and QStringList::sort().
.SS "\fBQString\fP KCharsets::languageForEncoding (const \fBQString\fP & encoding)"
.PP
Returns the language the encoding is used for. 
.PP
\fBParameters:\fP
.RS 4
\fIencoding\fP the encoding for the language 
.RE
.PP
\fBReturns:\fP
.RS 4
the language of the encoding 
.RE
.PP

.PP
Definition at line 517 of file kcharsets.cpp.
.PP
Referenced by descriptiveEncodingNames().
.SS "\fBQString\fP KCharsets::encodingForName (const \fBQString\fP & descriptiveName)"
.PP
Returns the encoding for a string obtained with \fBdescriptiveEncodingNames()\fP. 
.PP
\fBParameters:\fP
.RS 4
\fIdescriptiveName\fP the descriptive name for the encoding 
.RE
.PP
\fBReturns:\fP
.RS 4
the name of the encoding 
.RE
.PP

.PP
Definition at line 524 of file kcharsets.cpp.
.PP
References QString::findRev(), QString::left(), and QString::stripWhiteSpace().

.SH "Author"
.PP 
Generated automatically by Doxygen for kdecore Library from the source code.
