From e5fd2417701c1ecf35a3c771c647d931cef3f375 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Fri, 31 Jan 2014 10:36:04 +0100 Subject: Fix QByteArray documentation w.r.t. QString-related methods There's no loss of data when converting a Unicode string to UTF-8, so don't state that in the docs. Change-Id: If26914ec674a994d9c59136448e8e4292d0412e8 Reviewed-by: Thiago Macieira --- src/corelib/tools/qbytearray.cpp | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) (limited to 'src/corelib/tools/qbytearray.cpp') diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp index 03b10903ab..3e3bae9a94 100644 --- a/src/corelib/tools/qbytearray.cpp +++ b/src/corelib/tools/qbytearray.cpp @@ -1303,12 +1303,10 @@ void QByteArray::chop(int n) returns a reference to this byte array. The Unicode data is 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::toUtf8() (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::operator+=(const char *str) @@ -1667,12 +1665,10 @@ QByteArray &QByteArray::append(const QByteArray &ba) Appends the string \a str to this byte array. The Unicode data is 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::toUtf8() (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 *}. */ /*! @@ -2148,12 +2144,10 @@ QByteArray &QByteArray::replace(char before, const QByteArray &after) string \a after. The Unicode data is 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::toUtf8() (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(char before, const char *after) -- cgit v1.2.3