Commit Graph

1280 Commits (bb10)

Author SHA1 Message Date
Mårten Nordheim dbff2edaa1 Update UCD to Unicode 16.0.0
They added some new scripts.

There were a few changes to the line break algorithm,
most notably there is more rules that require more context than before.
While not major, there was some shuffling and additions to our
implementation to match the new rules.

IDNA test data now disallows the trailing dot/empty root label,
technically to be toggled off by an option that controls a few things,
but we don't have options. For test-data they changed the format a
little - "" is used to mean empty string, while a blank segment is
null/no string, update the parser to read this.

Changes in this cherry-pick:
  - Reran tool to resolve conflicts due to
    emoji-data not being extracted in this branch

[ChangeLog][Third-Party Code] Updated the Unicode Character Database to
UCD revision 34/Unicode 16.

Fixes: QTBUG-132902
Task-number: QTBUG-132851
Pick-to: 6.5
Change-Id: I4569703659f6fd0f20943110a03301c1cf8cc1ed
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 85899ff181984a1310cd1ad10cdb0824f1ca5118)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 5985c90d37a096f35b68546f916bec29a218e112)
2025-02-17 14:39:31 +01:00
Mårten Nordheim 5d78dd12ba Unicode tool: use unsigned values for the bitfields
On MSVC the values stored end up as negative.

Conflicts resolved in cherry-pick:
  - The emoji-data code didn't exist in this branch

Task-number: QTBUG-132902
Pick-to: 6.5
Change-Id: I963c57c34479041911c1364a1100d04998bdfaed
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 62685375a2d71fa34015faac76f03e709e4217c7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 09b06a740dd5e2ea08b49f76a2c384e6eb6fa6c6)
2025-02-10 15:33:50 +00:00
Marc Mutz 198bf9f50a util/update_public_suffix_list.sh: use commit date, not wall clock
This is both more accurate and also more stable: The suffix-list
update usually takes several days to go through all branches; using
the commit date avoids using newer fetch dates in older branches.

Pick-to: 6.5 6.2 5.15
Change-Id: Ifefd7158e4104c7bbdfe6a2d8a505d8acf7275b4
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit cbea57f80b43a969d2e15d53b759abb9924d52c1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 0ce4cdddb46c90acd7c037d764616925663212f4)
2025-02-02 15:09:25 +00:00
Marc Mutz 08db6dc0ee util/update_public_suffix_list.sh: adapt to PURL addition to qt_attribution.json
Also add a comment to publicsuffix-list's entry that the update is
done by a script that should be updated whenever this file's contents
change.

Amends 36dca3c04f759449f74008a3e79021a179b0f35e.

Pick-to: 6.5
Change-Id: I1a0e51568e6d4300197c09f759ad3d82277a74d1
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit b9f74f9a0b97588fc07d75fa6a427f5c8d6a2c6c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 94e4f3c53214d65f6049d44064c348e95682ef8b)
2025-01-23 14:26:31 +00:00
Jani Heikkinen 26dbd670d7 Bump version to 6.8.3
Change-Id: Ia3e12247064f4977aae2d666f742cca0b2d772ac
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-01-23 11:04:42 +00:00
Mate Barany 5fbe185931 Update CLDR to v46
New languages added with v46
- Kara-Kalpak
- Swampy Cree

Several new Chinese-language locales have been added, including one
using Latin script, which invalidated some prior QLocale tests, which
have been adjusted to fit.

Some obsolete time-zone identifiers are now treated as deprecated
aliases. These have lost their AnyTerritory association, implying
changes to QTimeZone tests.

Many redundant likely sub-tag rules for unspecified language have been
dropped, in favor of simpler rules.

[ChangeLog][Third-Party Code] Updated CLDR data, used by QLocale, to
v46.

Task-number: QTBUG-130877
Change-Id: I92cf210422c7759dd829a7ca2f845d20e263d25b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit e316276b76b9c3768ca4e19a04d03308ef21fe12)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 9413c19cc1f394bc39a9f46d7d12a71fb42c8d1a)
2025-01-14 11:15:42 +01:00
Mate Barany 4f2c976b7e Add type annotations to Locale
Task-number: QTBUG-129564
Change-Id: I6fe00162251ffa56c86ba2af98b8f066c9b5f09b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit bb32299e75c1eb4c4125455d184dd633733b3fb0)
2024-12-12 20:11:12 +00:00
Edward Welbourne 15189742c8 QLocale: fix likely subtags to include und -> en_Latn_US
The lack of this was hidden by other rules (redundant with it) until
CLDR v45, but v46 prunes the redundant rules, breaking this. So
include the missing rule and tweak the code that assumed likely
sub-tag rules preserved language, since this one doesn't. Rework the
tail of withLikelySubtagsAdded() to correctly use this rule, now that
we have it. (The prior comment about there being no match-all was
wrong: CLDR did have it, but our data skipped it.) Amended one test
affected by it (when system locale wasn't en_US).

On picking to 6.8, uiLanguages() needed some coaxing to avoid
duplicate C locale entries in tests of qualified C locale.

Task-number: QTBUG-130877
Change-Id: I2a415b67af4bc8aa6a766bcc1e349ee5bda9f174
Reviewed-by: Mate Barany <mate.barany@qt.io>
(cherry picked from commit 303863170c3ea7d1ee1b7188f507ad432ed3f860)
2024-12-10 12:35:05 +01:00
Mate Barany 4ef53255ed Add type annotations to QLocaleXmlWriter
Also fix the annotation of englishNaming in cldr.py. Spotted it while
annotating __enumTable.

Task-number: QTBUG-129564
Change-Id: I93f698b4cf1b5ae90c21fe77330e4f167143a9f3
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 3045a08e5edd5d8bc7c94f425ea60a7f48786ac1)
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2024-12-10 11:35:05 +00:00
Edward Welbourne 34f6bf5b7c Correct some type-annotations in util/locale_database/
Amends commit 3b541daff7 to deal with
likely subtags being handled as tuples of enum names, rather than as
tuples of their numeric values. The change from names to value went to
6.9 (commit bd5bb70b7c980d737d03db7a9d00b864fa144de0) but isn't picked
back to 6.8 or earlier. However, the type annotations done on 6.9
after that were picked back to 6.8 and I missed this twist in review.

Task-number: QTBUG-129613
Change-Id: I35eb21d26db1ff0537ecaf5e727431a16c6443c4
Reviewed-by: Mate Barany <mate.barany@qt.io>
2024-12-06 16:11:35 +01:00
Volker Hilsheimer e4495d8321 Fix build of lexgen tool
Use QMultiHash explicitly, and build list of values in a QSet via the
range constructor.

Task-number: QTBUG-131842
Change-Id: I9cbcddeada0bfd88b11515262f5476e5d59e0fad
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit e1217cc52bd367b7e040edeb86700dc923df39a8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-12-05 02:29:48 +00:00
Edward Welbourne 06f77ab19c Correct handling of World in mapping MS's zone IDs to IANA ones
The AnyTerritory entries in the zoneDataTable are derived from
territory="ZZ" entries in the upstream CLDR data; the World ones from
territory="001". The latter give the default IANA ID for each MS ID,
the former give an (often legacy) IANA ID for the MS ID, that is not
based on geography. Some of these are being removed at CLDR v46.

The documentation said the ZZ entries have "no known territorial
association", hinting that there may be some (unknown) territorial
association; however, CLDR's inclusion of them is as entries with a
known non-territorial association, so revise the phrasing to reflect
this.

Also document that windowsIdToDefaultIanaId() returns empty when
there is no territory-specific value, and callers can use the
territory-neutral call to get a suitable value in that case. (They
may, however, wish to distinguish this case, to treat it differently,
so I decided not to just return that in place of empty in any case.)

The upstream CLDR tables do have entries for territory 001, so we
should report these if asked for World as territory. Amend the
available zone ID lookup and mapping from MS to IANA functions that
take a territory to duly handle World via the default-data that was
derived from 001 data in CLDR, instead of from the territory-varying
table, from which those were effectively filtered out when generating
the two tables. Update docs to mention this handling of World, for
contrast with that of AnyTerritory.

In the process remove a spurious split-on-space from the MS to default
IANA lookup, asserting there is no space (in a field now stored in the
table for single IANA ID entries, instead of the one for space-joined
lists of them in which it used to be stored, before I noticed it's
always only one ID). There is a matching assertion in the cldr.py code
that extracts the data. Added an assertion to this last, that each
default IANA ID given by CLDR's MS data does in fact also appear as
one of the IANA IDs for at least one territory (potentially ZZ), and
comment in C++ code on why this means we don't need to scan the
windowsDataTable in a few places, where it would just produce
duplicate entries.

On picking to 6.8, removed the timezone_locale addition, only relevant
on 6.9 and later.

[ChangeLog][QtCore][QTimeZone] Corrected handling of QLocale::World
and clarified in docs how QLocale::AnyTerritory is handled when
QTimeZone selects zones by territory.

Task-number: QTBUG-130877
Change-Id: I861c777c68b0cb73a194138fe23fbff839df49e6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit e23dc7c420297fb62db9834a17c59bbf5992dad7)
Reviewed-by: Mate Barany <mate.barany@qt.io>
2024-12-04 11:50:36 +01:00
Mate Barany 6c775b478c Add type annotations to Spacer
Task-number: QTBUG-129564
Change-Id: I942d135da630f7ba6641170a1a597b0578aca878
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
(cherry picked from commit 519d3d36c38fb68945c2d42ba3bc5786c27aa693)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-12-03 08:19:33 +00:00
Mate Barany 8c0867699c Add type annotations to QLocaleXmlReader
Task-number: QTBUG-129564
Change-Id: I8711152840e6bcb39ff1b1e67ff60b53801f28f0
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit feb39b2d033eae19937e86eca89c1c96141a0b4f)
2024-12-02 19:44:08 +00:00
Alexandru Croitor e2ba5d9053 CMake: Add PURL and CPE info to 3rd party attribution files
The change adds CPE and PURL keys to all qt_attribution.json files in
the repo.

In case if no sensible CPE or PURL exists, a "Comment" field is added
with the text "no relevant CPE or PURL found". If only one of them
does not exist, it is written as such in the Comment field.

This allows filtering for files that haven't had the information added
yet vs those that were looked up but no relevant information was
found.

For sources that are not hosted on github, a generic PURL is used with
a download_url fragment pointing either to the exact location where
the sources can be downloaded, or to the homepage of the project.
The generic package name was chosen based on the 'Id' key of the
attribution entry where it was present, and is not authoritative.

For PURL github packages, the 'git tag' name was specified into the
'version' part of the PURL, rather than the 'version number', because
SBOM processing tooling handle that better than the version number.
For example for the freetype package, we specify the string
'VER-2-13-3' rather than the tag name '2.13.3'.
We might revisit this in the future.

[ChangeLog][Third-Party Code] Added PURL and CPE information to the
attribution files of 3rd party sources.

Task-number: QTBUG-122899
Task-number: QTBUG-129602
Change-Id: Iad126242cafc3ea0b678c5c36b26f857039b1dbd
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 36dca3c04f759449f74008a3e79021a179b0f35e)
2024-11-15 17:41:43 +01:00
Jani Heikkinen 429bf6cbb2 Bump version to 6.8.2
Change-Id: I6cc4fcc89a134afabc464f18adc3d0c3c01b8a78
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-11-14 15:04:34 +00:00
Mate Barany 3b541daff7 Add type annotations to CldrReader
Add some type annotatons to cldr2qlocalexml.py as well. Based on the
default arguments the constructor of CldrReader was expecting callables
that return None, but in reality we are passing in functions that
return integers.

Task-number: QTBUG-129613
Change-Id: I06832240956ea635ca0cc0ec45c466a3b2539ff7
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 812f79e75f2d6f2675c4b032f3a98610721e98de)
2024-11-13 15:08:05 +01:00
Edward Welbourne 33bf7dc9f8 Make static constexpr data tables inline in corelib/t*/q*_data_p.h
This should keep gcc from complaining that they're unused const
variables. Pick to 6.8 required conflict resolutions in non-generated
code and qlocalexml2cpp.py due to dev's updates to handle time zone
name L10n; regeneration of data took care of the other conflicts.

Fixes: QTBUG-128930
Change-Id: I4d0bccc5f158dfc72e4cf38a085b90cb562dc185
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 08ef4d232df82c056d4f5fda636b62b65fc054ad)
2024-11-13 15:04:00 +01:00
Mate Barany a5022c1917 Add type annotations to CldrAccess
Task-number: QTBUG-129613
Change-Id: I8a00cca718554909b7ab9dcad15cc9b9ac702e94
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit defd1549de9a26607e888fae8d82029633ca6d17)
2024-11-11 12:57:11 +00:00
Lucie Gérard 27ae8dbab4 Add REUSE.toml files
Those files are read by reuse to complement or override the copyright
and licensing information found in file.

The use of REUSE.toml files was introduced in REUSE version 3.1.0a1.
This reuse version is compatible with reuse specification
version 3.2 [1].
With this commit's files,
* The SPDX document generated by reuse spdx conforms to SPDX 2.3,
* The reuse lint command reports that the Qt project is reuse compliant.

[1]: https://reuse.software/spec-3.2/

Task-number: QTBUG-124453
Task-number: QTBUG-125211
Change-Id: I01023e862607777a5e710669ccd28bbf56091097
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 4c83657448f66ac0ee46900aff2e5a230eda49b0)
2024-11-07 08:38:49 +01:00
Edward Welbourne cff042eb53 Correct an earlier pick
Amends commit 52909797ac, whose conflict
resolutions inadvertently incorporated the movement of IANA IDs from
the list table to the IANA table, a change only done on dev (6.9), not
picked back to 6.8, but tagged with a # TODO comment in 6.8 that, none
the less, is not to be done in 6.8.

Restore writing to the correct table.

Change-Id: I70fd133eb54526efecae189306b3ae07c1c638db
Reviewed-by: Mate Barany <mate.barany@qt.io>
2024-11-05 12:58:43 +01:00
Edward Welbourne d4989135f9 Fix check for duplicated Windows time-zone IDs
A missing update of a "last" variable meant the loop inevitably did
nothing useful. Include type-annotation for last, while doing this.
Thankfully the check still doesn't find any duplications, now that
I've fixed it so that actually would, were any present.

Pick-to: 6.5
Change-Id: I672e6570359a3ff102a364d8af98c5c8c0bdc4d9
Reviewed-by: Mate Barany <mate.barany@qt.io>
(cherry picked from commit 98db7a35d2ee56f5da11b4a8e745f2ee6a965077)
2024-10-30 16:09:52 +01:00
Mate Barany 35a0bfd1e3 Add type annotations to LocaleScanner
Task-number: QTBUG-129566
Change-Id: I768fda6b5202ebabc8283ecedead9157653862be
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit b9e4f53b7e46636e886e41dde5693420dbfd81dc)
2024-10-28 10:02:22 +00:00
Mate Barany 18d790810e Remove unused parameters, variables from cldr.py and ldml.py
Found these while adding type annotations.

Task-number: QTBUG-129566
Change-Id: I51c8e5676f958094946c0e6f396b98c083fd9de0
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit ba9d6b261b04119b15d27f3f57dcfe0aadad5012)
2024-10-26 00:04:48 +00:00
Mate Barany b560a2c996 Add type annotations to XmlScanner and Supplement in ldml.py
Task-number: QTBUG-129566
Change-Id: I0300e97222c9d4b3e521a147e58c948c0015ad59
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 2b167291befb21b3ecdc3d9b1123890f1a3178fc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-26 00:04:48 +00:00
Mate Barany a1dd67ebfc Add type annotations to the Node class in ldml.py
Task-number: QTBUG-129566
Change-Id: I70a85654584cdd1117cd670337709620ad84e6d8
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 60cb610a403d8d18d5b33288025bd409fb1c1b84)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-26 00:04:46 +00:00
Mate Barany 20ccdf05a7 Add some type annotations to main in qlocalexml2cpp.py
Task-number: QTBUG-128634
Change-Id: Iaf5a25da86dd330bdab893b34c7c1288e239a182
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit cd6491e9500dc6e0ebe6a39ea791e3c643223a62)
2024-10-25 23:00:36 +02:00
Mate Barany 17fb626443 Add type annotations to three classes in qlocalexm2cpp.py
Add type annotations to CalendarDataWriter, TestLocaleWriter and
LocaleHeaderWriter.

Task-number: QTBUG-128634
Change-Id: I2c9168fda9cb79cbef3e7ef32ec67270ce168a1b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit a9a5f86a8becb12b9a33fbd92d1bb1c6c5421f45)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-23 15:56:48 +00:00
Mate Barany 315f79f887 Add type annotations to LocaleDataWriter
Task-number: QTBUG-128634
Change-Id: I63e4db06d92e7c2457a802f93372545f9ae749f1
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 001f8b3fc991b685b2a08b572af8be0a6eee60ea)
2024-10-23 15:56:42 +00:00
Mate Barany 52909797ac Add type hints to LocaleSourceEditor and TimeZoneDataWriter
Task-number: QTBUG-128634
Change-Id: I5dabb5e721b610bc9edb01b86aa173d03c36a48a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit dd698dcb4d14ec59fdd60416018b15e43438ecfe)
2024-10-23 15:56:27 +00:00
Mate Barany 0d06c01611 Add type annotations to ByteArrayData, StringDataToken and StringData
Add some type hints to unicode2hex as well, it is used by
ByteArrayData.

Task-number: QTBUG-128634
Change-Id: I86b7ce8567483bf8a4d4db78c9585652526cb90d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit c1ffb6e7515621a953b5ebf19c384b27df785d73)
2024-10-23 15:56:22 +00:00
Mate Barany d8128041e0 Add type annotations to LocaleKeySorter
Task-number: QTBUG-128634
Change-Id: I9a4261746cac029b0abf26fbd03b1915a0035147
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
(cherry picked from commit bd475ddf47e33535c2b79367c8850cd611089e3c)
2024-10-17 19:30:34 +00:00
Edward Welbourne c5e38fd385 Fix sorting of timezone alias table to be in case-insensitive order
The lookup into it is done case-insensitively (because user-supplied
names of zones might not have the right case) but I forgot to make the
sorting of the data table case-insensitive in the aliases. Regenerate
data: only the qtimezone*_data_p.h are changed by the reindexing of
zone aliases.

On picking to 6.8, drop the change to QTZlocale_data_p.h, as that's
not active until 6.9; and back-date the QTZprivate_data_p.h to match
the change on dev four days ago, as that might just reduce the risk of
later conflicts.

Change-Id: Id5e95c245c7ca421a77298f23baefe6b7021a396
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit ff58e09c8d5b3f505d5d3fe9a205e35e96de922d)
Reviewed-by: Mate Barany <mate.barany@qt.io>
2024-10-17 21:30:33 +02:00
Thiago Macieira ea5bff8feb qsimd_x86: disable the requirement that CPUs must have RNGs
Intel CPUs have had this since 2013 (Ivy Bridge), but some older
Bulldozer AMD CPUs appear to be missing it. This creates a mismatch
between when the __haswell__ macro gets declared in qsimd_p.h and the
runtime check using the CpuArchHaswell value. That in turn creates a
condition where qInitDrawhelperFunctions() in qdrawhelper.cpp leaves the
memfill pointers set to null.

#elif defined(__SSE2__)
#  ifndef __haswell__
    qt_memfill32 = qt_memfill32_sse2;
    qt_memfill64 = qt_memfill64_sse2;
#  endif
...
#if defined(QT_COMPILER_SUPPORTS_AVX2)
    if (qCpuHasFeature(ArchHaswell)) {
        qt_memfill32 = qt_memfill32_avx2;
        qt_memfill64 = qt_memfill64_avx2;

It does this so the qt_memfillXX_sse2 functions don't have to be defined
anywhere, so the QtGui build won't carry unnecessary dead code.

This is old code (from Qt 4.x) and several improvements I've made for
QtCore are not applied yet. My work for qSimdDispatcher[1] isn't
complete: it might have avoided this problem here, but it would also
have required major work for the draw helpers to work in the first
place.

[1] https://codereview.qt-project.org/c/qt/qtbase/+/537384

Pick-to: 6.7 6.5 6.2
Fixes: QTBUG-129193
Change-Id: Ia427a9e502b0fb46b2bdfffda8e2131b7091c9e9
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 54c24313fe1e4ed58b3260189cb623a7c852ab1d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-25 14:43:21 +00:00
Jani Heikkinen cbdc0d3d5d Bump version to 6.8.1
Change-Id: Ic8432157af13404391a5314ac2f44ac09abcfca5
Reviewed-by: Akseli Salovaara <akseli.salovaara@qt.io>
2024-09-19 07:20:47 +03:00
Mate Barany 9709c4f842 Use replace instead of rename in localetools.py
On Unix, if target exists and it is a file, rename silently replaces it
if the user has permission. However, on Windows, if the target exists,
FileExistError will be raised.

With replace, if target points to an existing file or empty directory,
it will be unconditionally replaced.

Change-Id: I2774152fec78a00c4ca6c9d1b927e503df2f2e84
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit eff8e6b885dfa3f26523ca39164725b4932c31bd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-18 09:51:00 +00:00
Mate Barany d8e1416977 Add a note to README about encoding errors on windows
Using the default system encoding cldr2qlocalexml.py and
qlocalexml2cpp.py may terminate with encoding errors on Windows.

Warn the user to set the PYTHONUTF8 environment variable to 1 before
running those scripts to avoid encoding errors.

Change-Id: I315a45072cb6ea516d3e9bb7613c6f251792ec59
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit b3ef2fdd8b99c6920a382fbbc417209bf436c3f3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-18 09:50:58 +00:00
Mate Barany b0e2abfe9a Fix typo in cldr.py
The variable ianalist is not really used for anything, it was probably
meant to be ianaList.

Change-Id: Ie9f42bf9716da28ee0017319dda96389c415ef4f
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 67ec126168b81adc2adc9fdb346c0a913c3c501d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-18 09:50:55 +00:00
Edward Welbourne bcd33276d1 Include relevant Unicode Inc. copyright line in generated data files
This amends commit 880d1aef99 and
extends it to cover the testlocales program under util/.

Pick-to: 6.7 6.5
Task-number: QTBUG-121653
Change-Id: I3efadc69ce08810876f8e20aa4636c7624728153
Reviewed-by: Lucie Gerard <lucie.gerard@qt.io>
(cherry picked from commit 00644f4b6d69d82a8d27f3b0619de88c0e4fdd6f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-31 08:56:42 +00:00
Edward Welbourne 6a0f00ac4e Update CLDR to v45, adding language Kuvi
This was in fact present in v44, but we overlooked it somehow. The new
version also fixes some inconsistencies in the data, that I reported
against v44.1; in particular, Tamil no longer claims to override the
root AM/PM markers (probably because it uses 24-hour time so doesn't
need them).

Add the test-file under util to the list of files containing generated
content.

Conflict at 6.8 resolved by regenerating the data; this only changed
the date of generation, not the data. Then hand-edited the date to
match the picked upstream commit, to avoid future conflicts.

[ChangeLog][Third-Party Code] Updated CLDR data, used by QLocale, to
v45.

Task-number: QTBUG-126060
Pick-to: 6.7 6.5 6.2
Change-Id: I81a5bcca49519b55091fc541de6b73b606661bb4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit f79548e268a496698d77d0e78365334d0e507212)
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-07-17 12:57:30 +02:00
Edward Welbourne 877e77eced qlocalexml2cpp.py: rework StringData handling of bit-sizes
Move to construction time, instead of passing to each append() call;
the table's field sizes are, after all, the same for all entries.
Add support for larger tables by allowing more than 16-bit indices.

Task-number: QTBUG-115158
Change-Id: I8f1113482e80838c512da6353fa17b9f365f956a
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Mate Barany <mate.barany@qt.io>
2024-06-02 15:26:17 +02:00
Edward Welbourne 69aefa4edf Update C Locale constructor to match others on ids and codes
It was setting *_code='0' for the Any* forms of language, script and
territory; this is wrong, the codes for these are all empty or other
special tokens (like 'und', 'Zzzz', 'ZZ'). The IDs for them are zero,
as an int not a string, but were omitted. Also add the variant
details, for all that they're currently unused, for consistency.

This makes no difference to the generated data.

Task-number: QTBUG-115158
Change-Id: I339d1b201e50e2bbc510758ffbbaae0fa02277d4
Reviewed-by: Mate Barany <mate.barany@qt.io>
2024-06-02 15:26:05 +02:00
Edward Welbourne 0c809fc3b5 Derive C locale data from en_US, overriding minor details
The qlocalexml.py Locale.C() had to replicate a whole lot of data that
isn't really relevant to how C differs from en_US and every addition
to what we support required further additions to it. So pass the en_US
Locale object to the pseudoconstructor so that C can inherit from it
and only override the parts where we care about the difference.

Hand-code shortening for short Jalali month names, to match Soroush's
original contribution, and include the narrow forms in the hard-coded
data to keep the generated data unchanged (for now). Note some of the
departures from CLDR; we may want to drop these overrides later.

In the process, convert the mapping from keys to locales to
consistently use IDs for all members of the key, instead of using the
(empty) code value for (as yet unused) variant; it now gets ID 0 and
is consistent with returns from codesToIdNames(). This makes life
easier for the code that now has to construct an en_US key.

Task-number: QTBUG-115158
Change-Id: I3d7acb6a4059daec1bba341fcf015c39c7a6803b
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2024-06-02 15:25:52 +02:00
Edward Welbourne 5641b17e2f qlocalexml2cpp.py: Make clear that ByteArrayData is always ASCII
The container would be unsuitable otherwise.

Change-Id: I0b0aa22625fbd638bf8409c5ee257f62332d8e05
Reviewed-by: Mate Barany <mate.barany@qt.io>
2024-06-02 15:25:45 +02:00
Edward Welbourne 72a7dddc25 QLocaleXML: Improve documentation, tidy up a bit
Omit parentheses round what python will form into a tuple anyway.
Include trailing commas on last entries of tuples so adding future
entries don't drag the existing line into their diffs.
Let the writer's tag-opener handle attributes, if supplied.
Clean up spacing in some doc-strings.
This is all preparation for further changes, to limit their diffs.

Change-Id: I989ae28bbd235b2af9c1d72467d4741c4f1f20ae
Reviewed-by: Mate Barany <mate.barany@qt.io>
2024-06-02 15:25:36 +02:00
Edward Welbourne 9534341654 Integrate timezone data into the CLDR-via-QLocaleXml pipeline
Future work shall need the timezone alias data to be synchronized
between the (expanded) locale-independent timezone data and the
(coming) locale-dependent timezone data. The latter shall need to come
via QLocaleXml, hence the former now needs to, too.

This makes no change to the generated data, aside from changing the
regeneration instructions for qtimezoneprivate_data_p.h, to use the
same scripts as locale data, instead of cldr2qtimezone.py, which is
now removed.

Task-number: QTBUG-115158
Change-Id: I47ddd95f6af1855cbb1f601e9074c13f213cd61c
Reviewed-by: Mate Barany <mate.barany@qt.io>
2024-06-02 15:25:27 +02:00
Edward Welbourne 4e23dbb742 Add assorted notes and suggestions in util/locale_database/
Change-Id: I22534943f2c9710d501235672811a861a5fd3aea
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-06-02 15:25:21 +02:00
Edward Welbourne b48b4f4d3b Simplify UTC offset ID data by computing the offsets
It's trivial to do - and done when generating our compiled data
tables, so makes no difference to users - but makes the offset list
table simpler. Reformat the list so that the fragment-of-hour offsets
are clearly distinguished from the whole-hour ones.

Change-Id: I6e0ea23dc317542b3256e88492e4073faedef1d7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2024-06-02 15:25:13 +02:00
Edward Welbourne 08c877a703 Update the utcIdList (now that I've worked out where it came from)
It was originally (without any comment to this effect, either in the
code or the commit message) just the list of offset-zones
corresponding to known Windows zones' offsets, augmented to include
each whole hour offset out to ±14 hours. Absent documentation, of
course, this was not maintained.

Added the four offset zones implied by that, that hadn't been added
when new entries joined the Windows IDs with novel offsets. Check,
after scanning CLDR for Windows data, that this has been kept up to
date. Updated the generated data.

Change-Id: I3cf3932c320876f7f2f74840d8c3951be49cfe70
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-06-02 15:25:07 +02:00
Edward Welbourne 99475db542 Revise Windows time-zone mapping to use proper IANA IDs
The CLDR's "IANA" IDs may (for the sake of stability) date back to
before IANA's own naming has been updated. As a result, the "IANA" IDs
we were using were in some cases out of date. CLDR does provide a
mapping from its stable IDs to all aliases and the current IANA name
for each (which I shall soon be needing in other work), so use that to
map the CLDR IDs to contemporary IANA ones.

Revise the documentation of CldrAccess.readWindowsTimeZones() to take
this into account, pass it the alias mapping from the table, use that
to map IDs internally and, in passing, rename a variable.  Update
cldr2qtimezone.py to match the new CldrAccess methods and regenerate
the data.

Change-Id: I23d8a7d048d76392099d125376b544a41faf7eb3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mate Barany <mate.barany@qt.io>
2024-05-30 20:28:55 +02:00