qt5base-lts/tests/auto/corelib
Edward Welbourne 300aaec2f9 Fix digit grouping when digits are surrogat pairs
This is a follow-up to commit ed2b110b6a
to fix indexing errors. Added the test that should have accompanied
that commit, which found some bugs, and refined the Indian number
formatting test (on which it's based).

Make variable i in the loops that insert grouping characters in a
number be consistently a *character* offset - which, when each digit
is a surrogate pair, isn't the same as an index into the
QString. Apply the needed scaling when indexing with it, not when
setting it or decrementing it. Don't assume the separator has the same
width as a digit.

Differences in index no longer give the number of digits between two
points in a string, so actively track how many digits we've seen in a
group when converting a numeric string to the C locale. Partially
cleaned up the code for that in the process (more shall follow when I
sort out digit grouping properly, without special-casing India).

Change-Id: I13d0f24efa26e599dfefb5733e062088fa56d375
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-04-17 13:43:50 +02:00
..
animation Merge remote-tracking branch 'origin/5.15' into dev 2020-03-16 18:41:27 +01:00
codecs Clean up memory 2020-04-17 11:24:35 +02:00
global Merge remote-tracking branch 'origin/5.15' into dev 2020-04-08 20:11:39 +02:00
io Port test over to use QRegularExpression 2020-04-13 09:40:38 +02:00
itemmodels Remove QRegExp support from QSortFilterProxyModel 2020-04-15 14:38:40 +02:00
kernel Simplify signature of untyped property bindings 2020-04-17 11:24:10 +02:00
mimetypes QtConcurrent::run: accept more then five function's arguments 2020-03-11 14:46:25 +01:00
plugin Change qHash() to work with size_t instead of uint 2020-04-09 20:03:25 +02:00
serialization Merge remote-tracking branch 'origin/5.15' into dev 2020-04-11 14:59:13 +02:00
statemachine Merge remote-tracking branch 'origin/5.15' into dev 2020-02-13 18:31:40 +01:00
text Fix digit grouping when digits are surrogat pairs 2020-04-17 13:43:50 +02:00
thread Add support of failure handler callbacks to QFuture 2020-04-01 21:51:13 +02:00
time Make QLocale(QString) explicit 2020-04-01 09:29:26 +01:00
tools Change qHashBits to use MurmurHash2 2020-04-09 20:03:45 +02:00
.prev_CMakeLists.txt cmake: Remove APPLE prefix from platform names 2020-03-16 17:57:56 +01:00
CMakeLists.txt cmake: Remove APPLE prefix from platform names 2020-03-16 17:57:56 +01:00
corelib.pro Move text-related code out of corelib/tools/ to corelib/text/ 2019-07-10 17:05:30 +02:00