From 8e7225440aa8eb42f58b33ba4e98844f7f19d250 Mon Sep 17 00:00:00 2001 From: Cheng Date: Mon, 25 Sep 2023 11:35:18 +1000 Subject: [PATCH] my exception code was too clever by half --- src/unit_test.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/unit_test.cpp b/src/unit_test.cpp index e4ec4e0..989106c 100644 --- a/src/unit_test.cpp +++ b/src/unit_test.cpp @@ -264,26 +264,27 @@ static bool checkDataConversionsProduceExpected(void){ } static bool CheckForUtfEnvironment(void) { - ILogMessage("\tChecking for UTF locale. ☹"); + ILogMessage("\tChecking for UTF locale. ☺"); try { bool utfEnvironment{ true }; + std::string cum{}; if constexpr (b_WINDOWS) { auto ACP{ GetACP() }; // Check that windows thinks this is UTF8 utfEnvironment = utfEnvironment && (ACP == 65001); if (!utfEnvironment) { - szError = std::format("current code page {}, —should be 65001☹, ", ACP); + cum += std::format("current code page {}, —should be 65001☹, ", ACP); } } auto FontEncoding{ wxLocale::GetSystemEncoding() }; // check that wxWidgets thinks this is UTF8 utfEnvironment = utfEnvironment && (FontEncoding == wxFONTENCODING_UTF8); if (!utfEnvironment) { - szError += std::format("swxFontEncoding {}, – should be {} ☹", + cum += std::format("swxFontEncoding {}, —should be {} ☹", (int)FontEncoding, (int)wxFONTENCODING_UTF8 ); - throw MyException(szError, __LINE__, __func__, SrcFilename); + throw MyException(cum, __LINE__, __func__, SrcFilename); } } catch (const MyException& e) {