diff options
author | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2023-06-09 17:30:54 +0300 |
---|---|---|
committer | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2023-06-09 17:30:54 +0300 |
commit | da6e958319e95fe564d3b30c931492dd666bfaff (patch) | |
tree | 16ac1556a573daeba5c9c4b795f86aa166ffe467 /src/corelib/time/qtimezoneprivate_icu.cpp | |
parent | 29400a683f96867133b28299c0d0bd6bcf40df35 (diff) | |
parent | a96fc76fa78f3500266b3a34016f9e1bd29b319c (diff) |
Merge remote-tracking branch 'origin/tqtc/lts-5.15.11' into tqtc/lts-5.15-opensourcev5.15.11-lts-lgpl
Change-Id: Iac056a5e9f59fc8d1929171c18039aeb45be22b8
Diffstat (limited to 'src/corelib/time/qtimezoneprivate_icu.cpp')
-rw-r--r-- | src/corelib/time/qtimezoneprivate_icu.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/corelib/time/qtimezoneprivate_icu.cpp b/src/corelib/time/qtimezoneprivate_icu.cpp index 8a92bbb387..2ef3a785da 100644 --- a/src/corelib/time/qtimezoneprivate_icu.cpp +++ b/src/corelib/time/qtimezoneprivate_icu.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2013 John Layt <jlayt@kde.org> +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. @@ -264,11 +265,10 @@ static QList<QByteArray> uenumToIdList(UEnumeration *uenum) static int ucalDaylightOffset(const QByteArray &id) { UErrorCode status = U_ZERO_ERROR; - const int32_t dstMSecs = ucal_getDSTSavings(reinterpret_cast<const UChar *>(id.data()), &status); - if (U_SUCCESS(status)) - return (dstMSecs / 1000); - else - return 0; + const QString utf16 = QString::fromLatin1(id); + const int32_t dstMSecs = ucal_getDSTSavings( + reinterpret_cast<const UChar *>(utf16.data()), &status); + return U_SUCCESS(status) ? dstMSecs / 1000 : 0; } // Create the system default time zone |