Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package kcodecs for openSUSE:Factory checked in at 2021-10-18 21:58:27 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/kcodecs (Old) and /work/SRC/openSUSE:Factory/.kcodecs.new.1890 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "kcodecs" Mon Oct 18 21:58:27 2021 rev:96 rq:924417 version:5.87.0 Changes: -------- --- /work/SRC/openSUSE:Factory/kcodecs/kcodecs.changes 2021-09-16 23:15:31.631851458 +0200 +++ /work/SRC/openSUSE:Factory/.kcodecs.new.1890/kcodecs.changes 2021-10-18 22:00:02.578000287 +0200 @@ -1,0 +2,12 @@ +Sun Oct 3 20:33:36 UTC 2021 - Christophe Giboudeaux <[email protected]> + +- Update to 5.87.0 + * New feature release + * For more details please see: + * https://kde.org/announcements/frameworks/5/5.87.0 +- Changes since 5.86.0: + * Add Gitlab CI configuration + * KCodecs::decodeRFC2047String(): return "UTF-8" when multiple charsets used + * Add CI configuration file + +------------------------------------------------------------------- Old: ---- kcodecs-5.86.0.tar.xz kcodecs-5.86.0.tar.xz.sig New: ---- kcodecs-5.87.0.tar.xz kcodecs-5.87.0.tar.xz.sig ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kcodecs.spec ++++++ --- /var/tmp/diff_new_pack.Y9SmaP/_old 2021-10-18 22:00:03.150000700 +0200 +++ /var/tmp/diff_new_pack.Y9SmaP/_new 2021-10-18 22:00:03.154000703 +0200 @@ -17,14 +17,14 @@ %define lname libKF5Codecs5 -%define _tar_path 5.86 +%define _tar_path 5.87 # Full KF5 version (e.g. 5.33.0) %{!?_kf5_version: %global _kf5_version %{version}} # Last major and minor KF5 version (e.g. 5.33) %{!?_kf5_bugfix_version: %define _kf5_bugfix_version %(echo %{_kf5_version} | awk -F. '{print $1"."$2}')} %bcond_without lang Name: kcodecs -Version: 5.86.0 +Version: 5.87.0 Release: 0 Summary: Method collection to manipulate strings using various encodings License: LGPL-2.1-or-later ++++++ kcodecs-5.86.0.tar.xz -> kcodecs-5.87.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kcodecs-5.86.0/.gitlab-ci.yml new/kcodecs-5.87.0/.gitlab-ci.yml --- old/kcodecs-5.86.0/.gitlab-ci.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/kcodecs-5.87.0/.gitlab-ci.yml 2021-10-02 16:23:29.000000000 +0200 @@ -0,0 +1,5 @@ +# SPDX-FileCopyrightText: 2020 Volker Krause <[email protected]> +# SPDX-License-Identifier: CC0-1.0 + +include: + - https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/linux.yml diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kcodecs-5.86.0/.kde-ci.yml new/kcodecs-5.87.0/.kde-ci.yml --- old/kcodecs-5.86.0/.kde-ci.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/kcodecs-5.87.0/.kde-ci.yml 2021-10-02 16:23:29.000000000 +0200 @@ -0,0 +1,7 @@ +Dependencies: +- 'on': ['@all'] + 'require': + 'frameworks/extra-cmake-modules': '@same' + +Options: + test-before-installing: True diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kcodecs-5.86.0/CMakeLists.txt new/kcodecs-5.87.0/CMakeLists.txt --- old/kcodecs-5.86.0/CMakeLists.txt 2021-09-04 18:56:45.000000000 +0200 +++ new/kcodecs-5.87.0/CMakeLists.txt 2021-10-02 16:23:29.000000000 +0200 @@ -1,10 +1,10 @@ cmake_minimum_required(VERSION 3.16) -set(KF_VERSION "5.86.0") # handled by release scripts +set(KF_VERSION "5.87.0") # handled by release scripts project(KCodecs VERSION ${KF_VERSION}) include(FeatureSummary) -find_package(ECM 5.86.0 NO_MODULE) +find_package(ECM 5.87.0 NO_MODULE) set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://commits.kde.org/extra-cmake-modules") feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kcodecs-5.86.0/autotests/rfc2047test.cpp new/kcodecs-5.87.0/autotests/rfc2047test.cpp --- old/kcodecs-5.86.0/autotests/rfc2047test.cpp 2021-09-04 18:56:45.000000000 +0200 +++ new/kcodecs-5.87.0/autotests/rfc2047test.cpp 2021-10-02 16:23:29.000000000 +0200 @@ -74,10 +74,13 @@ << QByteArray("ISO-8859-1") << QByteArray("utf-8") << false << QString::fromUtf8("Subject: Belangrijk: Verhuizing FTP server"); - // mixed charsets, based on bug 125542 but pasted from above instead since I'm unable to enter those asian symbols + // mixed charsets, based on bug 125542 QTest::newRow("mixed charsets") << QByteArray("Subject: =?utf-8?q?Ingo=20Kl=C3=B6cker?= unencoded words =?iso-8859-9?Q?S=2E=C7a=F0lar?=") - << QByteArray("ISO-8859-9") << QByteArray("utf-8") << false + << QByteArray("UTF-8") << QByteArray("utf-8") << false << QString::fromUtf8("Subject: Ingo Kl??cker unencoded words S.??a??lar"); + QTest::newRow("mixed charsets-125542") << QByteArray("Subject: =?koi8-r?b?5MXMz9fJINrB?= HP Pavillion =?iso-8859-5?b?KNzV3N7g2PjQIN/e4dXR3d4p?=") + << QByteArray("UTF-8") << QByteArray("us-ascii") << false + << QString::fromUtf8("Subject: ???????????? ???? HP Pavillion (???????????????? ??????????????)"); // illegal characters which are already encoded in the given encoding but are not ASCII (bug 206417) QTest::newRow("illegal characters") << QByteArray("Subject: =?utf-8?Q?????????????,=20=D0=B4=D0=BE=D0=B1=D1=80=D1=8B=D0=B9=20=D0=B4=D0=B5=D0=BD=D1=8C?=") @@ -150,11 +153,11 @@ << QByteArray("bla"); QTest::newRow("QP") << QString::fromUtf8("Ingo Kl??cker <[email protected]>") << QByteArray("utf-8") - << QByteArray("=?utf-8?q?Ingo=20Kl=C3=B6cker?= <[email protected]>"); + << QByteArray("=?UTF-8?q?Ingo=20Kl=C3=B6cker?= <[email protected]>"); QTest::newRow("utf-8 fallback") << QString::fromUtf8("??????????????") << QByteArray("latin1") - << QByteArray("=?utf-8?B?w6bFv8OwxJHFi8SnxYI=?="); + << QByteArray("=?UTF-8?B?w6bFv8OwxJHFi8SnxYI=?="); /* clang-format on */ } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kcodecs-5.86.0/po/zh_CN/kcodecs5_qt.po new/kcodecs-5.87.0/po/zh_CN/kcodecs5_qt.po --- old/kcodecs-5.86.0/po/zh_CN/kcodecs5_qt.po 2021-09-04 18:56:45.000000000 +0200 +++ new/kcodecs-5.87.0/po/zh_CN/kcodecs5_qt.po 2021-10-02 16:23:29.000000000 +0200 @@ -13,7 +13,7 @@ msgid "" msgstr "" "Project-Id-Version: kdeorg\n" -"PO-Revision-Date: 2021-08-30 11:43\n" +"PO-Revision-Date: 2021-09-27 13:07\n" "Language-Team: Chinese Simplified\n" "Language: zh_CN\n" "MIME-Version: 1.0\n" @@ -110,7 +110,7 @@ #: kcharsets.cpp:216 msgctxt "KCharsets|@item Text character set" msgid "Other" -msgstr "??????" +msgstr "??????" #: kcharsets.cpp:651 #, qt-format @@ -122,7 +122,7 @@ #, qt-format msgctxt "KCharsets|@item" msgid "Other encoding (%1)" -msgstr "???????????? (%1)" +msgstr "???????????? (%1)" #: kcharsets.cpp:682 #, qt-format diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kcodecs-5.86.0/src/kcodecs.cpp new/kcodecs-5.87.0/src/kcodecs.cpp --- old/kcodecs-5.86.0/src/kcodecs.cpp 2021-09-04 18:56:45.000000000 +0200 +++ new/kcodecs-5.87.0/src/kcodecs.cpp 2021-10-02 16:23:29.000000000 +0200 @@ -62,6 +62,30 @@ return charsetCache.last(); } +namespace CodecNames +{ +QByteArray utf8() +{ + return QByteArrayLiteral("UTF-8"); +} +} + +Q_REQUIRED_RESULT +QByteArray updateEncodingCharset(const QByteArray ¤tCharset, const QByteArray &nextCharset) +{ + if (!nextCharset.isEmpty()) { + if (currentCharset.isEmpty()) { + return nextCharset; + } + if (currentCharset != nextCharset) { + // only one charset per string supported, so change to superset charset UTF-8, + // which should cover any possible chars + return CodecNames::utf8(); + } + } + return currentCharset; +} + } // namespace KCodecs /******************************** KCodecs ********************************/ @@ -304,7 +328,7 @@ } } if (usedCS) { - *usedCS = cs; + *usedCS = updateEncodingCharset(*usedCS, cs); } if (!matchOK || !textCodec) { @@ -348,7 +372,7 @@ QString KCodecs::decodeRFC2047String(const QString &msg) { QByteArray usedCS; - return decodeRFC2047String(msg.toUtf8(), &usedCS, "utf-8", NoOption); + return decodeRFC2047String(msg.toUtf8(), &usedCS, CodecNames::utf8(), NoOption); } QString KCodecs::decodeRFC2047String(const QByteArray &src, QByteArray *usedCS, const QByteArray &defaultCS, CharsetOption charsetOption) @@ -358,6 +382,9 @@ const char *scursor = src.constData(); const char *send = scursor + src.length(); bool onlySpacesSinceLastWord = false; + if (usedCS) { + usedCS->clear(); + } while (scursor != send) { // space @@ -400,6 +427,9 @@ const QString tryUtf8 = QString::fromUtf8(result); if (tryUtf8.contains(0xFFFD)) { QTextCodec *codec = QTextCodec::codecForLocale(); + if (usedCS) { + *usedCS = updateEncodingCharset(*usedCS, cachedCharset(codec->name())); + } return codec->toUnicode(result); } else { return tryUtf8; @@ -435,7 +465,7 @@ QTextCodec::ConverterState converterState(QTextCodec::IgnoreHeader); QByteArray encoded8Bit = codec->fromUnicode(src.constData(), src.length(), &converterState); if (converterState.invalidChars > 0) { - usedCS = "utf-8"; + usedCS = CodecNames::utf8(); codec = QTextCodec::codecForName(usedCS); encoded8Bit = codec->fromUnicode(src); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kcodecs-5.86.0/src/kcodecs.h new/kcodecs-5.87.0/src/kcodecs.h --- old/kcodecs-5.86.0/src/kcodecs.h 2021-09-04 18:56:45.000000000 +0200 +++ new/kcodecs-5.87.0/src/kcodecs.h 2021-10-02 16:23:29.000000000 +0200 @@ -298,7 +298,9 @@ * =?charset?[qb]?encoded?= * * @param src source string. - * @param usedCS the detected charset is returned here + * @param usedCS the name of any detected charset or, in case of multiple + * different ones, "UTF-8" as that of a super charset is + * returned here * @param defaultCS the charset to use in case the detected * one isn't known to us. * @param option options for the encoder
