The QChar class provides a lightweight Unicode character.
.PP
Unicode characters are (so far) 16-bit entities without any markup or structure. This class represents such an entity. It is lightweight, so it can be used everywhere. Most compilers treat it like a "short int". (In a few years it may be necessary to make QChar 32-bit when more than 65536 Unicode code points have been defined and come into use.)
.PP
QChar provides a full complement of testing/classification functions, converting to and from other formats, converting from composed to decomposed Unicode, and trying to compare and case-convert if you ask it to.
.PP
The classification functions include functions like those in ctype.h, but operating on the full range of Unicode characters. They all return TRUE if the character is a certain type of character; otherwise they return FALSE. These classification functions are isNull() (returns TRUE if the character is U+0000), isPrint() (TRUE if the character is any sort of printable character, including whitespace), isPunct() (any sort of punctation), isMark() (Unicode Mark), isLetter (a letter), isNumber() (any sort of numeric character), isLetterOrNumber(), and isDigit() (decimal digits). All of these are wrappers around category() which return the Unicode-defined category of each character.
.PP
QChar further provides direction(), which indicates the "natural" writing direction of this character. The joining() function indicates how the character joins with its neighbors (needed mostly for Arabic) and finally mirrored(), which indicates whether the character needs to be mirrored when it is printed in its" unnatural" writing direction.
.PP
Composed Unicode characters (like å) can be converted to decomposed Unicode ("a" followed by "ring above") by using decomposition().
In Unicode, comparison is not necessarily possible and case conversion is very difficult at best. Unicode, covering the" entire" world, also includes most of the world's case and sorting problems. TQt tries, but not very hard: operator==() and friends will do comparison based purely on the numeric Unicode value (code point) of the characters, and upper() and lower() will do case changes when the character has a well-defined upper/lower-case equivalent. There is no provision for locale-dependent case folding rules or comparison; these functions are meant to be fast so they can be used unambiguously in data structures. (See QString::localeAwareCompare() though.)
The conversion functions include unicode() (to a scalar), latin1() (to scalar, but converts all non-Latin-1 characters to 0), row() (gives the Unicode row), cell() (gives the Unicode cell), digitValue() (gives the integer value of any of the numerous digit characters), and a host of constructors.
.PP
More information can be found in the document About Unicode.
.PP
See also QString, QCharRef, and Text Related Classes.
.SS "Member Type Documentation"
.SH "QChar::Category"
This enum maps the Unicode character categories.
.PP
The following characters are normative in Unicode:
.TP
\fCQChar::Mark_NonSpacing\fR - Unicode class name Mn
.TP
\fCQChar::Mark_SpacingCombining\fR - Unicode class name Mc
.TP
\fCQChar::Mark_Enclosing\fR - Unicode class name Me
.TP
\fCQChar::Number_DecimalDigit\fR - Unicode class name Nd
.TP
\fCQChar::Number_Letter\fR - Unicode class name Nl
.TP
\fCQChar::Number_Other\fR - Unicode class name No
.TP
\fCQChar::Separator_Space\fR - Unicode class name Zs
.TP
\fCQChar::Separator_Line\fR - Unicode class name Zl
.TP
\fCQChar::Separator_Paragraph\fR - Unicode class name Zp
.TP
\fCQChar::Other_Control\fR - Unicode class name Cc
.TP
\fCQChar::Other_Format\fR - Unicode class name Cf
.TP
\fCQChar::Other_Surrogate\fR - Unicode class name Cs
.TP
\fCQChar::Other_PrivateUse\fR - Unicode class name Co
.TP
\fCQChar::Other_NotAssigned\fR - Unicode class name Cn
.PP
The following categories are informative in Unicode:
.TP
\fCQChar::Letter_Uppercase\fR - Unicode class name Lu
.TP
\fCQChar::Letter_Lowercase\fR - Unicode class name Ll
.TP
\fCQChar::Letter_Titlecase\fR - Unicode class name Lt
.TP
\fCQChar::Letter_Modifier\fR - Unicode class name Lm
.TP
\fCQChar::Letter_Other\fR - Unicode class name Lo
.TP
\fCQChar::Punctuation_Connector\fR - Unicode class name Pc
.TP
\fCQChar::Punctuation_Dash\fR - Unicode class name Pd
.TP
\fCQChar::Punctuation_Open\fR - Unicode class name Ps
.TP
\fCQChar::Punctuation_Close\fR - Unicode class name Pe
.TP
\fCQChar::Punctuation_InitialQuote\fR - Unicode class name Pi
.TP
\fCQChar::Punctuation_FinalQuote\fR - Unicode class name Pf
.TP
\fCQChar::Punctuation_Other\fR - Unicode class name Po
.TP
\fCQChar::Symbol_Math\fR - Unicode class name Sm
.TP
\fCQChar::Symbol_Currency\fR - Unicode class name Sc
.TP
\fCQChar::Symbol_Modifier\fR - Unicode class name Sk
Returns the combining class for the character as defined in the Unicode standard. This is mainly useful as a positioning hint for marks attached to a base character.
\fBThis function is obsolete.\fR It is provided to keep old source working. We strongly advise against using it in new code.
.PP
Returns TRUE if this character is in network byte order (MSB first); otherwise returns FALSE. This is platform dependent.
.SH "QChar::operator char () const"
Returns the Latin-1 character equivalent to the QChar, or 0. This is mainly useful for non-internationalized software.
.PP
See also unicode().
.SH "uchar QChar::row () const"
Returns the row (most significant byte) of the Unicode character.
.SH "ushort QChar::unicode () const"
Returns the numeric Unicode value equal to the QChar. Normally, you should use QChar objects as they are equivalent, but for some low-level tasks (e.g. indexing into an array of Unicode information), this function is useful.
.SH "ushort & QChar::unicode ()"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Returns a reference to the numeric Unicode value equal to the QChar.
.SH "QChar QChar::upper () const"
Returns the uppercase equivalent if the character is lowercase; otherwise returns the character itself.
.SH RELATED FUNCTION DOCUMENTATION
.SH "int operator!= ( QChar c1, QChar c2 )"
Returns TRUE if \fIc1\fR and \fIc2\fR are not the same Unicode character; otherwise returns FALSE.
.SH "int operator!= ( char ch, QChar c )"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Returns TRUE if \fIc\fR is not the ASCII/Latin-1 character \fIch\fR; otherwise returns FALSE.
.SH "int operator!= ( QChar c, char ch )"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Returns TRUE if \fIc\fR is not the ASCII/Latin-1 character \fIch\fR; otherwise returns FALSE.
.SH "int operator< ( QChar c1, QChar c2 )"
Returns TRUE if the numeric Unicode value of \fIc1\fR is less than that of \fIc2\fR; otherwise returns FALSE.
.SH "int operator< ( QChar c, char ch )"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Returns TRUE if the numeric Unicode value of \fIc\fR is less than that of the ASCII/Latin-1 character \fIch\fR; otherwise returns FALSE.
.SH "int operator< ( char ch, QChar c )"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Returns TRUE if the numeric Unicode value of the ASCII/Latin-1 character \fIch\fR is less than that of \fIc\fR; otherwise returns FALSE.
.SH "int operator<= ( QChar c1, QChar c2 )"
Returns TRUE if the numeric Unicode value of \fIc1\fR is less than that of \fIc2\fR, or they are the same Unicode character; otherwise returns FALSE.
.SH "int operator<= ( QChar c, char ch )"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Returns TRUE if the numeric Unicode value of \fIc\fR is less than or equal to that of the ASCII/Latin-1 character \fIch\fR; otherwise returns FALSE.
.SH "int operator<= ( char ch, QChar c )"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Returns TRUE if the numeric Unicode value of the ASCII/Latin-1 character \fIch\fR is less than or equal to that of \fIc\fR; otherwise returns FALSE.
.SH "bool operator== ( QChar c1, QChar c2 )"
Returns TRUE if \fIc1\fR and \fIc2\fR are the same Unicode character; otherwise returns FALSE.
.SH "bool operator== ( char ch, QChar c )"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Returns TRUE if \fIc\fR is the ASCII/Latin-1 character \fIch\fR; otherwise returns FALSE.
.SH "bool operator== ( QChar c, char ch )"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Returns TRUE if \fIc\fR is the ASCII/Latin-1 character \fIch\fR; otherwise returns FALSE.
.SH "int operator> ( QChar c1, QChar c2 )"
Returns TRUE if the numeric Unicode value of \fIc1\fR is greater than that of \fIc2\fR; otherwise returns FALSE.
.SH "int operator> ( QChar c, char ch )"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Returns TRUE if the numeric Unicode value of \fIc\fR is greater than that of the ASCII/Latin-1 character \fIch\fR; otherwise returns FALSE.
.SH "int operator> ( char ch, QChar c )"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Returns TRUE if the numeric Unicode value of the ASCII/Latin-1 character \fIch\fR is greater than that of \fIc\fR; otherwise returns FALSE.
.SH "int operator>= ( QChar c1, QChar c2 )"
Returns TRUE if the numeric Unicode value of \fIc1\fR is greater than that of \fIc2\fR, or they are the same Unicode character; otherwise returns FALSE.
.SH "int operator>= ( QChar c, char ch )"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Returns TRUE if the numeric Unicode value of \fIc\fR is greater than or equal to that of the ASCII/Latin-1 character \fIch\fR; otherwise returns FALSE.
.SH "int operator>= ( char ch, QChar c )"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Returns TRUE if the numeric Unicode value of the ASCII/Latin-1
character \fIch\fR is greater than or equal to that of \fIc\fR;
otherwise returns FALSE.
.SH "SEE ALSO"
.BR http://doc.trolltech.com/qchar.html
.BR http://www.trolltech.com/faq/tech.html
.SH COPYRIGHT
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the
license file included in the distribution for a complete license
statement.
.SH AUTHOR
Generated automatically from the source code.
.SH BUGS
If you find a bug in Qt, please report it as described in