mirror of https://github.com/qt/qt5compat.git
QText{En,De}coder: use DefaultConversion
In Qt 5, the flag to write the BOM was a negative: if IgnoreHeader wasn't set, we would write it. That was the default in Qt 5 because DefaultConversion was 0. But now it's a positive flag, DefaultConversion was updated to set it, but we forgot to use it in the constructors of these two classes. [ChangeLog][Qt5CoreCompat][QTextEncoder] Fixed a bug that caused QTextEncoder not to write the Byte Order Mark for UTF codecs when the constructor without explicit flags was used. Fixes: QTBUG-122795 Pick-to: 6.5 6.7 Change-Id: If1bf59ecbe014b569ba1fffd17c459af4e0e00c9 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
parent
22466dc051
commit
dd0ddad631
|
@ -93,7 +93,8 @@ class Q_CORE5COMPAT_EXPORT QTextEncoder
|
|||
{
|
||||
Q_DISABLE_COPY(QTextEncoder)
|
||||
public:
|
||||
explicit QTextEncoder(const QTextCodec *codec) : c(codec), state() {}
|
||||
explicit QTextEncoder(const QTextCodec *codec)
|
||||
: c(codec), state(QTextCodec::DefaultConversion) {}
|
||||
explicit QTextEncoder(const QTextCodec *codec, QTextCodec::ConversionFlags flags);
|
||||
~QTextEncoder();
|
||||
QByteArray fromUnicode(const QString& str);
|
||||
|
@ -109,7 +110,8 @@ class Q_CORE5COMPAT_EXPORT QTextDecoder
|
|||
{
|
||||
Q_DISABLE_COPY(QTextDecoder)
|
||||
public:
|
||||
explicit QTextDecoder(const QTextCodec *codec) : c(codec), state() {}
|
||||
explicit QTextDecoder(const QTextCodec *codec)
|
||||
: c(codec), state(QTextCodec::DefaultConversion) {}
|
||||
explicit QTextDecoder(const QTextCodec *codec, QTextCodec::ConversionFlags flags);
|
||||
~QTextDecoder();
|
||||
QString toUnicode(const char* chars, int len);
|
||||
|
|
Loading…
Reference in New Issue