Appends the string \a str onto the end of this byte array and
returns a reference to this byte array. The Unicode data is
- converted into 8-bit characters using QString::toAscii().
+ converted into 8-bit characters using QString::toUtf8().
If the QString contains non-ASCII Unicode characters, using this
operator can lead to loss of information. You can disable this
operator by defining \c QT_NO_CAST_TO_ASCII when you compile your
- applications. You then need to call QString::toAscii() (or
+ applications. You then need to call QString::toUtf8() (or
QString::toLatin1() or QString::toUtf8() or QString::toLocal8Bit())
explicitly if you want to convert the data to \c{const char *}.
*/
\overload
Appends the string \a str to this byte array. The Unicode data is
- converted into 8-bit characters using QString::toAscii().
+ converted into 8-bit characters using QString::toUtf8().
If the QString contains non-ASCII Unicode characters, using this
function can lead to loss of information. You can disable this
function by defining \c QT_NO_CAST_TO_ASCII when you compile your
- applications. You then need to call QString::toAscii() (or
+ applications. You then need to call QString::toUtf8() (or
QString::toLatin1() or QString::toUtf8() or QString::toLocal8Bit())
explicitly if you want to convert the data to \c{const char *}.
*/
Inserts the string \a str at index position \a i in the byte
array. The Unicode data is converted into 8-bit characters using
- QString::toAscii().
+ QString::toUtf8().
If \a i is greater than size(), the array is first extended using
resize().
- If the QString contains non-ASCII Unicode characters, using this
- function can lead to loss of information. You can disable this
- function by defining \c QT_NO_CAST_TO_ASCII when you compile your
- applications. You then need to call QString::toAscii() (or
- QString::toLatin1() or QString::toUtf8() or QString::toLocal8Bit())
- explicitly if you want to convert the data to \c{const char *}.
+ You can disable this function by defining \c QT_NO_CAST_TO_ASCII when you
+ compile your applications. You then need to call QString::toUtf8() (or
+ QString::toLatin1() or QString::toLocal8Bit()) explicitly if you want to
+ convert the data to \c{const char *}.
*/
/*!
Replaces every occurrence of the string \a before with the byte
array \a after. The Unicode data is converted into 8-bit
- characters using QString::toAscii().
+ characters using QString::toUtf8().
- If the QString contains non-ASCII Unicode characters, using this
- function can lead to loss of information. You can disable this
- function by defining \c QT_NO_CAST_TO_ASCII when you compile your
- applications. You then need to call QString::toAscii() (or
- QString::toLatin1() or QString::toUtf8() or QString::toLocal8Bit())
- explicitly if you want to convert the data to \c{const char *}.
+ You can disable this function by defining \c QT_NO_CAST_TO_ASCII when you
+ compile your applications. You then need to call QString::toUtf8() (or
+ QString::toLatin1() or QString::toLocal8Bit()) explicitly if you want to
+ convert the data to \c{const char *}.
*/
/*! \fn QByteArray &QByteArray::replace(const QString &before, const char *after)
Replaces every occurrence of the character \a before with the
string \a after. The Unicode data is converted into 8-bit
- characters using QString::toAscii().
+ characters using QString::toUtf8().
If the QString contains non-ASCII Unicode characters, using this
function can lead to loss of information. You can disable this
function by defining \c QT_NO_CAST_TO_ASCII when you compile your
- applications. You then need to call QString::toAscii() (or
+ applications. You then need to call QString::toUtf8() (or
QString::toLatin1() or QString::toUtf8() or QString::toLocal8Bit())
explicitly if you want to convert the data to \c{const char *}.
*/
\a from. Returns -1 if \a str could not be found.
The Unicode data is converted into 8-bit characters using
- QString::toAscii().
+ QString::toUtf8().
- If the QString contains non-ASCII Unicode characters, using this
- function can lead to loss of information. You can disable this
- function by defining \c QT_NO_CAST_TO_ASCII when you compile your
- applications. You then need to call QString::toAscii() (or
- QString::toLatin1() or QString::toUtf8() or QString::toLocal8Bit())
- explicitly if you want to convert the data to \c{const char *}.
+ You can disable this function by defining \c QT_NO_CAST_TO_ASCII when you
+ compile your applications. You then need to call QString::toUtf8() (or
+ QString::toLatin1() or QString::toLocal8Bit()) explicitly if you want to
+ convert the data to \c{const char *}.
*/
/*! \fn int QByteArray::indexOf(const char *str, int from) const
last (size() - 1) byte. Returns -1 if \a str could not be found.
The Unicode data is converted into 8-bit characters using
- QString::toAscii().
+ QString::toUtf8().
- If the QString contains non-ASCII Unicode characters, using this
- function can lead to loss of information. You can disable this
- function by defining \c QT_NO_CAST_TO_ASCII when you compile your
- applications. You then need to call QString::toAscii() (or
- QString::toLatin1() or QString::toUtf8() or QString::toLocal8Bit())
- explicitly if you want to convert the data to \c{const char *}.
+ You can disable this function by defining \c QT_NO_CAST_TO_ASCII when you
+ compile your applications. You then need to call QString::toUtf8() (or
+ QString::toLatin1() or QString::toLocal8Bit()) explicitly if you want to
+ convert the data to \c{const char *}.
*/
/*! \fn int QByteArray::lastIndexOf(const char *str, int from) const
otherwise returns false.
The Unicode data is converted into 8-bit characters using
- QString::toAscii().
+ QString::toUtf8().
The comparison is case sensitive.
You can disable this operator by defining \c
QT_NO_CAST_FROM_ASCII when you compile your applications. You
- then need to call QString::fromAscii(), QString::fromLatin1(),
- QString::fromUtf8(), or QString::fromLocal8Bit() explicitly if
- you want to convert the byte array to a QString before doing the
- comparison.
+ then need to call QString::fromUtf8(), QString::fromLatin1(),
+ or QString::fromLocal8Bit() explicitly if you want to convert the byte
+ array to a QString before doing the comparison.
*/
/*! \fn bool QByteArray::operator!=(const QString &str) const
otherwise returns false.
The Unicode data is converted into 8-bit characters using
- QString::toAscii().
+ QString::toUtf8().
The comparison is case sensitive.
You can disable this operator by defining \c
QT_NO_CAST_FROM_ASCII when you compile your applications. You
- then need to call QString::fromAscii(), QString::fromLatin1(),
- QString::fromUtf8(), or QString::fromLocal8Bit() explicitly if
- you want to convert the byte array to a QString before doing the
- comparison.
+ then need to call QString::fromUtf8(), QString::fromLatin1(),
+ or QString::fromLocal8Bit() explicitly if you want to convert the byte
+ array to a QString before doing the comparison.
*/
/*! \fn bool QByteArray::operator<(const QString &str) const
str; otherwise returns false.
The Unicode data is converted into 8-bit characters using
- QString::toAscii().
+ QString::toUtf8().
The comparison is case sensitive.
You can disable this operator by defining \c
QT_NO_CAST_FROM_ASCII when you compile your applications. You
- then need to call QString::fromAscii(), QString::fromLatin1(),
- QString::fromUtf8(), or QString::fromLocal8Bit() explicitly if
- you want to convert the byte array to a QString before doing the
- comparison.
+ then need to call QString::fromUtf8(), QString::fromLatin1(),
+ or QString::fromLocal8Bit() explicitly if you want to convert the byte
+ array to a QString before doing the comparison.
*/
/*! \fn bool QByteArray::operator>(const QString &str) const
\a str; otherwise returns false.
The Unicode data is converted into 8-bit characters using
- QString::toAscii().
+ QString::toUtf8().
The comparison is case sensitive.
You can disable this operator by defining \c
QT_NO_CAST_FROM_ASCII when you compile your applications. You
- then need to call QString::fromAscii(), QString::fromLatin1(),
- QString::fromUtf8(), or QString::fromLocal8Bit() explicitly if
- you want to convert the byte array to a QString before doing the
- comparison.
+ then need to call QString::fromUtf8(), QString::fromLatin1(),
+ or QString::fromLocal8Bit() explicitly if you want to convert the byte
+ array to a QString before doing the comparison.
*/
/*! \fn bool QByteArray::operator<=(const QString &str) const
to string \a str; otherwise returns false.
The Unicode data is converted into 8-bit characters using
- QString::toAscii().
+ QString::toUtf8().
The comparison is case sensitive.
You can disable this operator by defining \c
QT_NO_CAST_FROM_ASCII when you compile your applications. You
- then need to call QString::fromAscii(), QString::fromLatin1(),
- QString::fromUtf8(), or QString::fromLocal8Bit() explicitly if
- you want to convert the byte array to a QString before doing the
- comparison.
+ then need to call QString::fromUtf8(), QString::fromLatin1(),
+ or QString::fromLocal8Bit() explicitly if you want to convert the byte
+ array to a QString before doing the comparison.
*/
/*! \fn bool QByteArray::operator>=(const QString &str) const
\a str; otherwise returns false.
The Unicode data is converted into 8-bit characters using
- QString::toAscii().
+ QString::toUtf8().
The comparison is case sensitive.
You can disable this operator by defining \c
QT_NO_CAST_FROM_ASCII when you compile your applications. You
- then need to call QString::fromAscii(), QString::fromLatin1(),
- QString::fromUtf8(), or QString::fromLocal8Bit() explicitly if
- you want to convert the byte array to a QString before doing the
- comparison.
+ then need to call QString::fromUtf8(), QString::fromLatin1(),
+ or QString::fromLocal8Bit() explicitly if you want to convert the byte
+ array to a QString before doing the comparison.
*/
/*! \fn bool operator==(const QByteArray &a1, const QByteArray &a2)
\snippet qstring/main.cpp 0
QString converts the \c{const char *} data into Unicode using the
- fromAscii() function. fromAscii() treats ordinals above 128 as Latin-1
- characters.
+ fromUtf8() function.
In all of the QString functions that take \c{const char *}
parameters, the \c{const char *} is interpreted as a classic
- C-style '\\0'-terminated string. It is legal for the \c{const char
- *} parameter to be 0.
+ C-style '\\0'-terminated string encoded in UTF-8. It is legal for
+ the \c{const char *} parameter to be 0.
You can also provide string data as an array of \l{QChar}s:
\section1 Converting Between 8-Bit Strings and Unicode Strings
- QString provides the following four functions that return a
- \c{const char *} version of the string as QByteArray: toAscii(),
- toLatin1(), toUtf8(), and toLocal8Bit().
+ QString provides the following three functions that return a
+ \c{const char *} version of the string as QByteArray: toUtf8(),
+ toLatin1(), and toLocal8Bit().
\list
- \li toAscii() returns a Latin-1 (ISO 8859-1) encoded 8-bit string.
\li toLatin1() returns a Latin-1 (ISO 8859-1) encoded 8-bit string.
\li toUtf8() returns a UTF-8 encoded 8-bit string. UTF-8 is a
superset of US-ASCII (ANSI X3.4-1986) that supports the entire
\endlist
To convert from one of these encodings, QString provides
- fromAscii(), fromLatin1(), fromUtf8(), and fromLocal8Bit(). Other
+ fromLatin1(), fromUtf8(), and fromLocal8Bit(). Other
encodings are supported through the QTextCodec class.
As mentioned above, QString provides a lot of functions and
\snippet code/src_corelib_tools_qstring.cpp 0
- You then need to explicitly call fromAscii(), fromLatin1(),
- fromUtf8(), or fromLocal8Bit() to construct a QString from an
+ You then need to explicitly call fromUtf8(), fromLatin1(),
+ or fromLocal8Bit() to construct a QString from an
8-bit string, or use the lightweight QLatin1String class, for
example:
\snippet code/src_corelib_tools_qstring.cpp 1
- Similarly, you must call toAscii(), toLatin1(), toUtf8(), or
+ Similarly, you must call toLatin1(), toUtf8(), or
toLocal8Bit() explicitly to convert the QString to an 8-bit
string. (Other encodings are supported through the QTextCodec
class.)
\snippet qstring/main.cpp 8
All functions except isNull() treat null strings the same as empty
- strings. For example, toAscii().constData() returns a pointer to a
+ strings. For example, toUtf8().constData() returns a pointer to a
'\\0' character for a null string (\e not a null pointer), and
QString() compares equal to QString(""). We recommend that you
always use the isEmpty() function and avoid isNull().
Constructs a string initialized with the 8-bit string \a str. The
given const char pointer is converted to Unicode using the
- fromAscii() function.
+ fromUtf8() function.
You can disable this constructor by defining \c
QT_NO_CAST_FROM_ASCII when you compile your applications. This
can be useful if you want to ensure that all user-visible strings
go through QObject::tr(), for example.
- \sa fromAscii(), fromLatin1(), fromLocal8Bit(), fromUtf8()
+ \sa fromLatin1(), fromLocal8Bit(), fromUtf8()
*/
/*! \fn QString QString::fromStdString(const std::string &str)
Returns a copy of the \a str string. The given string is converted
- to Unicode using the fromAscii() function.
+ to Unicode using the fromUtf8() function.
This constructor is only available if Qt is configured with STL
compatibility enabled.
- \sa fromAscii(), fromLatin1(), fromLocal8Bit(), fromUtf8()
+ \sa fromLatin1(), fromLocal8Bit(), fromUtf8()
*/
/*! \fn QString QString::fromStdWString(const std::wstring &str)
This operator is mostly useful to pass a QString to a function
that accepts a std::wstring object.
- \sa utf16(), toAscii(), toLatin1(), toUtf8(), toLocal8Bit()
+ \sa utf16(), toLatin1(), toUtf8(), toLocal8Bit()
*/
// ### replace with QCharIterator
hold the complete string (allocating the array with the same length as the
string is always sufficient).
- returns the actual length of the string in \a array.
+ This function returns the actual length of the string in \a array.
\note This function does not append a null character to the array.
- \sa utf16(), toUcs4(), toAscii(), toLatin1(), toUtf8(), toLocal8Bit(), toStdWString()
+ \sa utf16(), toUcs4(), toLatin1(), toUtf8(), toLocal8Bit(), toStdWString()
*/
/*! \fn QString::QString(const QString &other)
/*! \fn QString::QString(const QByteArray &ba)
Constructs a string initialized with the byte array \a ba. The
- given byte array is converted to Unicode using fromAscii(). Stops
+ given byte array is converted to Unicode using fromUtf8(). Stops
copying at the first 0 character, otherwise copies the entire byte
array.
can be useful if you want to ensure that all user-visible strings
go through QObject::tr(), for example.
- \sa fromAscii(), fromLatin1(), fromLocal8Bit(), fromUtf8()
+ \sa fromLatin1(), fromLocal8Bit(), fromUtf8()
*/
/*! \fn QString::QString(const Null &)
\overload operator=()
Assigns \a ba to this string. The byte array is converted to Unicode
- using the fromAscii() function. This function stops conversion at the
+ using the fromUtf8() function. This function stops conversion at the
first NUL character found, or the end of the \a ba byte array.
You can disable this operator by defining \c
\overload operator=()
Assigns \a str to this string. The const char pointer is converted
- to Unicode using the fromAscii() function.
+ to Unicode using the fromUtf8() function.
You can disable this operator by defining \c
QT_NO_CAST_FROM_ASCII when you compile your applications. This
\overload operator=()
- Assigns character \a ch to this string. The character is converted
- to Unicode using the fromAscii() function.
+ Assigns character \a ch to this string. Note that the character is
+ converted to Unicode using the fromLatin1() function, unlike other 8-bit
+ functions that operate on UTF-8 data.
You can disable this operator by defining \c
QT_NO_CAST_FROM_ASCII when you compile your applications. This
\overload append()
Appends the byte array \a ba to this string. The given byte array
- is converted to Unicode using the fromAscii() function.
+ is converted to Unicode using the fromUtf8() function.
You can disable this function by defining \c QT_NO_CAST_FROM_ASCII
when you compile your applications. This can be useful if you want
\overload append()
Appends the string \a str to this string. The given const char
- pointer is converted to Unicode using the fromAscii() function.
+ pointer is converted to Unicode using the fromUtf8() function.
You can disable this function by defining \c QT_NO_CAST_FROM_ASCII
when you compile your applications. This can be useful if you want
\overload prepend()
Prepends the byte array \a ba to this string. The byte array is
- converted to Unicode using the fromAscii() function.
+ converted to Unicode using the fromUtf8() function.
You can disable this function by defining \c
QT_NO_CAST_FROM_ASCII when you compile your applications. This
\overload prepend()
Prepends the string \a str to this string. The const char pointer
- is converted to Unicode using the fromAscii() function.
+ is converted to Unicode using the fromUtf8() function.
You can disable this function by defining \c
QT_NO_CAST_FROM_ASCII when you compile your applications. This
\overload operator==()
The \a other byte array is converted to a QString using the
- fromAscii() function. This function stops conversion at the
+ fromUtf8() function. This function stops conversion at the
first NUL character found, or the end of the byte array.
You can disable this operator by defining \c
\overload operator==()
The \a other const char pointer is converted to a QString using
- the fromAscii() function.
+ the fromUtf8() function.
You can disable this operator by defining \c
QT_NO_CAST_FROM_ASCII when you compile your applications. This
\overload operator<()
The \a other byte array is converted to a QString using the
- fromAscii() function. If any NUL characters ('\\0') are embedded
+ fromUtf8() function. If any NUL characters ('\\0') are embedded
in the byte array, they will be included in the transformation.
You can disable this operator by defining \c
\overload operator<()
The \a other const char pointer is converted to a QString using
- the fromAscii() function.
+ the fromUtf8() function.
You can disable this operator by defining \c
QT_NO_CAST_FROM_ASCII when you compile your applications. This
\overload operator<=()
The \a other byte array is converted to a QString using the
- fromAscii() function. If any NUL characters ('\\0') are embedded
+ fromUtf8() function. If any NUL characters ('\\0') are embedded
in the byte array, they will be included in the transformation.
You can disable this operator by defining \c
\overload operator<=()
The \a other const char pointer is converted to a QString using
- the fromAscii() function.
+ the fromUtf8() function.
You can disable this operator by defining \c
QT_NO_CAST_FROM_ASCII when you compile your applications. This
\overload operator>()
The \a other byte array is converted to a QString using the
- fromAscii() function. If any NUL characters ('\\0') are embedded
+ fromUtf8() function. If any NUL characters ('\\0') are embedded
in the byte array, they will be included in the transformation.
You can disable this operator by defining \c
\overload operator>()
The \a other const char pointer is converted to a QString using
- the fromAscii() function.
+ the fromUtf8() function.
You can disable this operator by defining \c QT_NO_CAST_FROM_ASCII
when you compile your applications. This can be useful if you want
\overload operator>=()
The \a other byte array is converted to a QString using the
- fromAscii() function. If any NUL characters ('\\0') are embedded in
+ fromUtf8() function. If any NUL characters ('\\0') are embedded in
the byte array, they will be included in the transformation.
You can disable this operator by defining \c QT_NO_CAST_FROM_ASCII
\overload operator>=()
The \a other const char pointer is converted to a QString using
- the fromAscii() function.
+ the fromUtf8() function.
You can disable this operator by defining \c QT_NO_CAST_FROM_ASCII
when you compile your applications. This can be useful if you want
\overload operator!=()
The \a other byte array is converted to a QString using the
- fromAscii() function. If any NUL characters ('\\0') are embedded
+ fromUtf8() function. If any NUL characters ('\\0') are embedded
in the byte array, they will be included in the transformation.
You can disable this operator by defining \c QT_NO_CAST_FROM_ASCII
\overload operator!=()
The \a other const char pointer is converted to a QString using
- the fromAscii() function.
+ the fromUtf8() function.
You can disable this operator by defining \c
QT_NO_CAST_FROM_ASCII when you compile your applications. This
characters. Those characters may be suppressed or replaced with a
question mark.
- \sa fromLatin1(), toAscii(), toUtf8(), toLocal8Bit(), QTextCodec
+ \sa fromLatin1(), toUtf8(), toLocal8Bit(), QTextCodec
*/
QByteArray QString::toLatin1() const
{
locale, the returned byte array is undefined. Those characters may be
suppressed or replaced by another.
- \sa fromLocal8Bit(), toAscii(), toLatin1(), toUtf8(), QTextCodec
+ \sa fromLocal8Bit(), toLatin1(), toUtf8(), QTextCodec
*/
QByteArray QString::toLocal8Bit() const
{
may be discarded and will not appear in the UTF-8 representation, or they
may be replaced by one or more replacement characters.
- \sa fromUtf8(), toAscii(), toLatin1(), toLocal8Bit(), QTextCodec
+ \sa fromUtf8(), toLatin1(), toLocal8Bit(), QTextCodec
*/
QByteArray QString::toUtf8() const
{
UCS-4 is a Unicode codec and is lossless. All characters from this string
can be encoded in UCS-4. The vector is not null terminated.
- \sa fromUtf8(), toAscii(), toLatin1(), toLocal8Bit(), QTextCodec, fromUcs4(), toWCharArray()
+ \sa fromUtf8(), toUtf8(), toLatin1(), toLocal8Bit(), QTextCodec, fromUcs4(), toWCharArray()
*/
QVector<uint> QString::toUcs4() const
{
If \a size is -1 (default), it is taken to be strlen(\a
str).
- \sa toLatin1(), fromAscii(), fromUtf8(), fromLocal8Bit()
+ \sa toLatin1(), fromUtf8(), fromLocal8Bit()
*/
QTextCodec::codecForLocale() is used to perform the conversion.
- \sa toLocal8Bit(), fromAscii(), fromLatin1(), fromUtf8()
+ \sa toLocal8Bit(), fromLatin1(), fromUtf8()
*/
QString QString::fromLocal8Bit_helper(const char *str, int size)
{
Unicode Plane (U+FFFE, U+FFFF, U+1FFFE, U+1FFFF, U+2FFFE, etc.), as well
as 16 codepoints in the range U+FDD0..U+FDDF, inclusive.
- \sa toUtf8(), fromAscii(), fromLatin1(), fromLocal8Bit()
+ \sa toUtf8(), fromLatin1(), fromLocal8Bit()
*/
QString QString::fromUtf8_helper(const char *str, int size)
{
\overload operator+=()
Appends the byte array \a ba to this string. The byte array is converted
- to Unicode using the fromAscii() function. If any NUL characters ('\\0')
+ to Unicode using the fromUtf8() function. If any NUL characters ('\\0')
are embedded in the \a ba byte array, they will be included in the
transformation.
\overload operator+=()
Appends the string \a str to this string. The const char pointer
- is converted to Unicode using the fromAscii() function.
+ is converted to Unicode using the fromUtf8() function.
You can disable this function by defining \c QT_NO_CAST_FROM_ASCII
when you compile your applications. This can be useful if you want
\overload operator+=()
- Appends the character \a ch to this string. The character is
- converted to Unicode using the fromAscii() function.
+ Appends the character \a ch to this string. Note that the character is
+ converted to Unicode using the fromLatin1() function, unlike other 8-bit
+ functions that operate on UTF-8 data.
You can disable this function by defining \c QT_NO_CAST_FROM_ASCII
when you compile your applications. This can be useful if you want
\relates QString
Returns a string which is the result of concatenating \a s1 and \a
- s2 (\a s2 is converted to Unicode using the QString::fromAscii()
+ s2 (\a s2 is converted to Unicode using the QString::fromUtf8()
function).
- \sa QString::fromAscii()
+ \sa QString::fromUtf8()
*/
/*!
\relates QString
Returns a string which is the result of concatenating \a s1 and \a
- s2 (\a s1 is converted to Unicode using the QString::fromAscii()
+ s2 (\a s1 is converted to Unicode using the QString::fromUtf8()
function).
- \sa QString::fromAscii()
+ \sa QString::fromUtf8()
*/
/*!
Returns a std::string object with the data contained in this
QString. The Unicode data is converted into 8-bit characters using
- the toAscii() function.
+ the toUtf8() function.
This operator is mostly useful to pass a QString to a function
that accepts a std::string object.
If the QString contains non-Latin1 Unicode characters, using this
can lead to loss of information.
- \sa toAscii(), toLatin1(), toUtf8(), toLocal8Bit()
+ \sa toLatin1(), toUtf8(), toLocal8Bit()
*/
/*!
\overload
The \a other const char pointer is converted to a QString using
- the QString::fromAscii() function.
+ the QString::fromUtf8() function.
You can disable this operator by defining \c
QT_NO_CAST_FROM_ASCII when you compile your applications. This
\overload operator!=()
The \a other const char pointer is converted to a QString using
- the QString::fromAscii() function.
+ the QString::fromUtf8() function.
You can disable this operator by defining \c
QT_NO_CAST_FROM_ASCII when you compile your applications. This
\overload
The \a other const char pointer is converted to a QString using
- the QString::fromAscii() function.
+ the QString::fromUtf8() function.
You can disable this operator by defining \c QT_NO_CAST_FROM_ASCII
when you compile your applications. This can be useful if you want
\overload
The \a other const char pointer is converted to a QString using
- the QString::fromAscii() function.
+ the QString::fromUtf8() function.
You can disable this operator by defining \c
QT_NO_CAST_FROM_ASCII when you compile your applications. This
\overload
The \a other const char pointer is converted to a QString using
- the QString::fromAscii() function.
+ the QString::fromUtf8() function.
You can disable this operator by defining \c
QT_NO_CAST_FROM_ASCII when you compile your applications. This
\overload
The \a other const char pointer is converted to a QString using
- the QString::fromAscii() function.
+ the QString::fromUtf8() function.
You can disable this operator by defining \c
QT_NO_CAST_FROM_ASCII when you compile your applications. This
characters. Those characters may be suppressed or replaced with a
question mark.
- \sa toAscii(), toUtf8(), toLocal8Bit(), QTextCodec
+ \sa toUtf8(), toLocal8Bit(), QTextCodec
*/
QByteArray QStringRef::toLatin1() const
{
locale, the returned byte array is undefined. Those characters may be
suppressed or replaced by another.
- \sa toAscii(), toLatin1(), toUtf8(), QTextCodec
+ \sa toLatin1(), toUtf8(), QTextCodec
*/
QByteArray QStringRef::toLocal8Bit() const
{
may be discarded and will not appear in the UTF-8 representation, or they
may be replaced by one or more replacement characters.
- \sa toAscii(), toLatin1(), toLocal8Bit(), QTextCodec
+ \sa toLatin1(), toLocal8Bit(), QTextCodec
*/
QByteArray QStringRef::toUtf8() const
{
UCS-4 is a Unicode codec and is lossless. All characters from this string
can be encoded in UCS-4.
- \sa toAscii(), toLatin1(), toLocal8Bit(), QTextCodec
+ \sa toUtf8(), toLatin1(), toLocal8Bit(), QTextCodec
*/
QVector<uint> QStringRef::toUcs4() const
{