mirror of
https://github.com/nlohmann/json.git
synced 2026-07-11 21:15:10 +00:00
Fix ci_icpc: skip UTF-8 u8-literal comparison test on classic ICC
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 <mail@nlohmann.me>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user