From bf843288ad83292b769448a0177e29fb4fe46090 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Fri, 10 Jul 2026 13:38:53 +0200 Subject: [PATCH] Fix ci_icpc: skip UTF-8 u8-literal comparison test on classic ICC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit test-deserialization_cpp20 failed: ERROR: CHECK( j2["emoji"] == "😀" ) is NOT correct! check_utf8() only guards against MSVC's ANSI-codepage quirk (its docstring example), but classic ICC has an analogous problem: it doesn't encode a narrow string literal containing non-ASCII source characters as UTF-8, so comparing a decoded u8R"(...)" literal against a narrow literal with the same characters fails. Extend the existing guard. Verified with the pinned astyle 3.4.13; no diff. Signed-off-by: Niels Lohmann --- tests/src/unit-deserialization.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/src/unit-deserialization.cpp b/tests/src/unit-deserialization.cpp index 0ade1ad52..cedcb21a9 100644 --- a/tests/src/unit-deserialization.cpp +++ b/tests/src/unit-deserialization.cpp @@ -227,6 +227,11 @@ bool check_utf8() // Runtime check of the active ANSI code page // 65001 == UTF-8 return GetACP() == 65001; +#elif defined(__ICC) || defined(__INTEL_COMPILER) + // classic Intel ICC does not encode narrow string literals containing + // non-ASCII source characters as UTF-8, so comparing a decoded u8 literal + // against a narrow string literal containing the same characters fails + return false; #else return true; #endif