From 509d4fa122cfe8d44d2bae2910dc566c1074078d Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Sat, 13 Jan 2024 15:35:46 -0800 Subject: [PATCH] Remove mbrtowc_invalid_utf8.cpp This was used in CMake to detect invalid mbrtowc implementations. The only known case was on SnowLeopard, which is no longer supported. Remove this file. --- cmake/checks/mbrtowc_invalid_utf8.cpp | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 cmake/checks/mbrtowc_invalid_utf8.cpp diff --git a/cmake/checks/mbrtowc_invalid_utf8.cpp b/cmake/checks/mbrtowc_invalid_utf8.cpp deleted file mode 100644 index c3fec11e4..000000000 --- a/cmake/checks/mbrtowc_invalid_utf8.cpp +++ /dev/null @@ -1,18 +0,0 @@ -#include -#include -#include -#include - -// Check whether the runtime mbrtowc implementation attempts to encode -// invalid UTF-8 values. - -int main() { - // TODO: I'm not sure how to enforce a UTF-8 locale without overriding the language - char sample[] = "hello world"; - sample[0] |= 0xF8; - wchar_t wsample[100] {}; - std::mbstate_t state = std::mbstate_t(); - int res = std::mbrtowc(wsample, sample, strlen(sample), &state); - - return res < 0 ? 0 : 1; -}