mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 10:52:56 +00:00
inline toLocal8Bit_helper() function and use it in QString::toLocal8Bit()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
67d9e14434
commit
f5d8e81c79
1 changed files with 2 additions and 6 deletions
|
@ -3179,7 +3179,7 @@ QByteArray QString::toAscii() const
|
|||
return QTextCodecPrivate::convertFrom(constData(), length(), "US-ASCII");
|
||||
}
|
||||
|
||||
static QByteArray toLocal8Bit_helper(const QChar *data, int length)
|
||||
static inline QByteArray toLocal8Bit_helper(const QChar *data, int length)
|
||||
{
|
||||
const QByteArray localecodec = QTextCodecPrivate::localeCodec();
|
||||
return QTextCodecPrivate::convertFrom(data, length, localecodec.constData());
|
||||
|
@ -3202,11 +3202,7 @@ static QByteArray toLocal8Bit_helper(const QChar *data, int length)
|
|||
*/
|
||||
QByteArray QString::toLocal8Bit() const
|
||||
{
|
||||
#ifndef QT_NO_TEXTCODEC
|
||||
return QTextCodec::codecForLocale()->fromUnicode(unicode(), length());
|
||||
#else
|
||||
return toLatin1();
|
||||
#endif // QT_NO_TEXTCODEC
|
||||
return toLocal8Bit_helper(unicode(), length());
|
||||
}
|
||||
|
||||
/*!
|
||||
|
|
Loading…
Add table
Reference in a new issue