Sophie

Sophie

distrib > Mandriva > 8.2 > i586 > media > contrib > by-pkgid > 112b0974ad288f6cd55bf971ee6026a9 > files > 2314

libqt3-devel-3.0.2-2mdk.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- /tmp/qt-3.0-reggie-28534/qt-x11-free-3.0.2/doc/unicode.doc:36 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>About Unicode</title>
<style type="text/css"><!--
h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
body { background: #ffffff; color: black; }
--></style>
</head>
<body>

<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr bgcolor="#E5E5E5">
<td valign=center>
 <a href="index.html">
<font color="#004faf">Home</font></a>
 | <a href="classes.html">
<font color="#004faf">All&nbsp;Classes</font></a>
 | <a href="mainclasses.html">
<font color="#004faf">Main&nbsp;Classes</font></a>
 | <a href="annotated.html">
<font color="#004faf">Annotated</font></a>
 | <a href="groups.html">
<font color="#004faf">Grouped&nbsp;Classes</font></a>
 | <a href="functions.html">
<font color="#004faf">Functions</font></a>
</td>
<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>About Unicode</h1>

 
<p> Unicode is a 16-bit character set, portable across all major computing
platforms and with decent coverage over most of the world.  It is
also single-locale; it includes no code pages or other complexities
that make software harder to write and test. There is
no competing character set that's reasonably cross-platform.  For
these reasons, Trolltech has chosen to make Unicode the native
character set of Qt starting with version 2.0.
<p> <h2> Information about Unicode on the web.  
</h2>
<a name="1"></a><p> The <a href="http://www.unicode.org">Unicode Consortium</a>
has a number of documents available, including
<p> <ul>
<p> <li> <a href="http://www.unicode.org/unicode/standard/principles.html">A technical introduction to Unicode</a>
<li> <a href="http://www.unicode.org/unicode/standard/standard.html">The home page for the standard</a>
<p> </ul>
<p> <h2> The Standard
</h2>
<a name="2"></a><p> The current version of the standard is 3.0.1. 
<p> <ul>
<p> <li> <a href="http://www.amazon.com/exec/obidos/ASIN/0201616335/trolltech/t">The Unicode Standard, version 3.0.</a>  See also
<a href="http://www.unicode.org/unicode/standard/versions/Unicode3.0.1.html">its home page.</a>
<li> <a href="http://www.amazon.com/exec/obidos/ASIN/0201473459/trolltech/t">The Unicode Standard, version 2.0.</a>  See also the
<a href="http://www.unicode.org/unicode/reports/tr8.html">2.1
update</a> and
<a href="http://www.unicode.org/unicode/standard/versions/enumeratedversions.html#Unicode">2.1.9 the 2.1.9 data files</a> at www.unicode.org.
<p> </ul>
<p> <h2> Unicode in Qt
</h2>
<a name="3"></a><p> In Qt, and in most applications that use Qt, most or all user-visible
strings are stored in Unicode. Qt provides:
<p> <ul>
<p> <li> Translation to/from legacy encodings for file I/O - see <a href="qtextcodec.html">QTextCodec</a> and <a href="qtextstream.html">QTextStream</a>.
<li> Translation from Input Methods and 8-bit keyboard input.
<li> Translation to legacy character sets for on-screen display.
<li> A string class, <a href="qstring.html">QString</a>, that stores Unicode characters, with
support for migrating from C strings including fast (cached)
translation to and from US-ASCII, and all the usual string
operations.
<li> Unicode-aware widgets where appropriate.
<li> Unicode support detection on Windows 95/98/NT/2000, so that Qt
provides Unicode even on Windows platforms that do not support it.
<p> </ul>
<p> To obtain the benefits of Unicode, we recommend using <a href="qstring.html">QString</a> for
storing all user-visible strings and performing all text file I/O using
<a href="qtextstream.html">QTextStream</a>.  Use <a href="qkeyevent.html#text">QKeyEvent::text</a>() for keyboard input in any
custom widgets you write; it does not make much difference for slow
typists in West Europe or North America, but for fast typists or
people using special input methods using text() is beneficial.
<p> All the function arguments in Qt that may be user-visible strings, <a href="qlabel.html#setText">QLabel::setText</a>() and a many others, take <tt>const QString &amp;</tt>
as type.  <a href="qstring.html">QString</a> provides implicit casting from <tt>const char *</tt>
such that things like
<p> <pre>
        myLabel-&gt;setText( "Hello, Dolly!" );
</pre>
 
<p> will work.  There is also a function, <a href="qobject.html#tr">QObject::tr</a>(), that provides
translation support, like this:
<p> <pre>
        myLabel-&gt;setText( tr("Hello, Dolly!") );
</pre>
 
<p> tr() (simplifying somewhat) maps from <tt>const char *</tt> to a
Unicode string, and uses installable <a href="qtranslator.html">QTranslator</a> objects to do the
mapping.
<p> Programs that need to talk to other programs or read/write files in
legacy file formats, Qt provides a number of built-in <a href="qtextcodec.html">QTextCodec</a>
classes, that is, classes that know how to translate between Unicode
and legacy encodings.
<p> By default, conversion to/from <tt>const char *</tt> uses a
locale-dependent codec.  However, the program can easily find codecs
for other locales, and set any open file or network connection to use
a special codec.  It is also possible to install new codecs, for
encodings that the built-in ones do not support.  (At the time of
writing, Vietnamese/VISCII is one such example.)
<p> Since US-ASCII and ISO-8859-1 are so common, there are also especially
fast functions for mapping to and from them.  For example, to open an
application's icon one might do this:
<p> <pre>
        <a href="qfile.html">QFile</a> f( QString::<a href="qstring.html#fromLatin1">fromLatin1</a>("appicon.png") );
</pre>
 
<p> Regarding output, Qt will do a best-effort conversion from
<a href="http://my.ispchannel.com/~markdavis/unicode/Unicode_transcription_images/U_Combined.gif">Unicode</a>
to whatever encoding the system and fonts provide.  Depending on
operating system, locale, font availability and Qt's support for the
characters used, this conversion may be good or bad.  We will extend
this in upcoming versions, with emphasis on the most common locales
first.
<p> 
<!-- eof -->
<p><address><hr><div align=center>
<table width=100% cellspacing=0 border=0><tr>
<td>Copyright &copy; 2001 
<a href="http://www.trolltech.com">Trolltech</a><td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a>
<td align=right><div align=right>Qt version 3.0.2</div>
</table></div></address></body>
</html>