qt6-bb10/tests/auto/corelib/io/qsettings
Tor Arne Vestbø 3eac6079d9 macOS: Don't mangle QByteArray settings with @ prefix by decoding as UTF-8
QSettings encodes QVariants as @Type(data) strings. If that data contains
a null-byte, we write the string as UTF-8 encoded CFData. When reading it
back we look for a @ prefix, and then pass it as UTF-8 through stringToVariant.

The problem arises then the user writes raw QByteArrays with a @ prefix.
We can detect this situation by checking the result of stringToVariant,
and if it's just a simple conversion of the string into a QVariant, we
know that stringToVariant hit its fallback path due to not finding any
embedded variants.

If that's the case, we return the raw bytes as a QByteArray.

Pick-to: 6.2 6.1 5.15 5.12
Change-Id: I4ac5c35d0a6890ebea983b9aca0a3a36b0143de2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-07-13 00:59:49 +02:00
..
.gitattributes Moving relevant tests to corelib/io 2011-08-31 10:08:38 +02:00
.gitignore Moving relevant tests to corelib/io 2011-08-31 10:08:38 +02:00
CMakeLists.txt QSettings: Add support for QMetaType::Float 2021-01-15 18:51:15 +01:00
bom.ini Properly detect UTF-8 BOM markers in ini files 2014-10-29 08:58:31 +01:00
float.ini QSettings: Add support for QMetaType::Float 2021-01-15 18:51:15 +01:00
qsettings.qrc QSettings: Add support for QMetaType::Float 2021-01-15 18:51:15 +01:00
resourcefile.ini Moving relevant tests to corelib/io 2011-08-31 10:08:38 +02:00
resourcefile2.ini Moving relevant tests to corelib/io 2011-08-31 10:08:38 +02:00
resourcefile3.ini Moving relevant tests to corelib/io 2011-08-31 10:08:38 +02:00
resourcefile4.ini Moving relevant tests to corelib/io 2011-08-31 10:08:38 +02:00
resourcefile5.ini Moving relevant tests to corelib/io 2011-08-31 10:08:38 +02:00
resourcefile6.plist Fix data corruption when reading byte arrays from QSettings 2017-02-03 15:37:58 +00:00
tst_qsettings.cpp macOS: Don't mangle QByteArray settings with @ prefix by decoding as UTF-8 2021-07-13 00:59:49 +02:00
withcomments.ini Fix QSettings parsing of spaces after comment lines 2018-12-07 18:53:34 +00:00