diff --git a/libcxx/test/std/input.output/file.streams/fstreams/filebuf.virtuals/overflow.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/filebuf.virtuals/overflow.pass.cpp --- a/libcxx/test/std/input.output/file.streams/fstreams/filebuf.virtuals/overflow.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/filebuf.virtuals/overflow.pass.cpp @@ -8,8 +8,6 @@ // REQUIRES: locale.en_US.UTF-8 -// XFAIL: LIBCXX-WINDOWS-FIXME - // // int_type overflow(int_type c = traits::eof()); diff --git a/libcxx/test/std/input.output/file.streams/fstreams/filebuf.virtuals/underflow.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/filebuf.virtuals/underflow.pass.cpp --- a/libcxx/test/std/input.output/file.streams/fstreams/filebuf.virtuals/underflow.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/filebuf.virtuals/underflow.pass.cpp @@ -9,8 +9,6 @@ // REQUIRES: locale.en_US.UTF-8 // FILE_DEPENDENCIES: underflow.dat, underflow_utf8.dat -// XFAIL: LIBCXX-WINDOWS-FIXME - // // int_type underflow(); diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp @@ -14,6 +14,13 @@ // charT tolower(charT) const; +// Windows' UCRT has a bug regarding tolower/touppwer when using UTF-8 +// locales, breaking this test: +// https://developercommunity.visualstudio.com/t/utf-8-locales-break-ctype-functions-for-wchar-type/1653678 +// The bug is fixed in UCRT 10.0.20348.0 and later (Windows Server 2022 +// or Windows 11). +// XFAIL: windows + #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp @@ -14,6 +14,13 @@ // const charT* tolower(charT* low, const charT* high) const; +// Windows' UCRT has a bug regarding tolower/touppwer when using UTF-8 +// locales, breaking this test: +// https://developercommunity.visualstudio.com/t/utf-8-locales-break-ctype-functions-for-wchar-type/1653678 +// The bug is fixed in UCRT 10.0.20348.0 and later (Windows Server 2022 +// or Windows 11). +// XFAIL: windows + #include #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp @@ -14,6 +14,12 @@ // charT toupper(charT) const; +// Windows' UCRT has a bug regarding tolower/touppwer when using UTF-8 +// locales, breaking this test: +// https://developercommunity.visualstudio.com/t/utf-8-locales-break-ctype-functions-for-wchar-type/1653678 +// The bug is fixed in UCRT 10.0.20348.0 and later (Windows Server 2022 +// or Windows 11). +// XFAIL: windows #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp @@ -14,6 +14,13 @@ // const charT* toupper(charT* low, const charT* high) const; +// Windows' UCRT has a bug regarding tolower/touppwer when using UTF-8 +// locales, breaking this test: +// https://developercommunity.visualstudio.com/t/utf-8-locales-break-ctype-functions-for-wchar-type/1653678 +// The bug is fixed in UCRT 10.0.20348.0 and later (Windows Server 2022 +// or Windows 11). +// XFAIL: windows + #include #include #include diff --git a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_monthname.pass.cpp b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_monthname.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_monthname.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_monthname.pass.cpp @@ -10,8 +10,6 @@ // REQUIRES: locale.fr_FR.UTF-8 // REQUIRES: locale.zh_CN.UTF-8 -// XFAIL: LIBCXX-WINDOWS-FIXME - // // class time_get_byname diff --git a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_weekday.pass.cpp b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_weekday.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_weekday.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_weekday.pass.cpp @@ -11,8 +11,6 @@ // REQUIRES: locale.ru_RU.UTF-8 // REQUIRES: locale.zh_CN.UTF-8 -// XFAIL: LIBCXX-WINDOWS-FIXME - // // class time_get_byname diff --git a/libcxx/test/std/re/re.traits/translate_nocase.pass.cpp b/libcxx/test/std/re/re.traits/translate_nocase.pass.cpp --- a/libcxx/test/std/re/re.traits/translate_nocase.pass.cpp +++ b/libcxx/test/std/re/re.traits/translate_nocase.pass.cpp @@ -14,6 +14,13 @@ // REQUIRES: locale.en_US.UTF-8 +// Windows' UCRT has a bug regarding tolower/touppwer when using UTF-8 +// locales, breaking this test: +// https://developercommunity.visualstudio.com/t/utf-8-locales-break-ctype-functions-for-wchar-type/1653678 +// The bug is fixed in UCRT 10.0.20348.0 and later (Windows Server 2022 +// or Windows 11). +// XFAIL: windows + #include #include diff --git a/libcxx/test/support/platform_support.h b/libcxx/test/support/platform_support.h --- a/libcxx/test/support/platform_support.h +++ b/libcxx/test/support/platform_support.h @@ -15,30 +15,21 @@ #define PLATFORM_SUPPORT_H // locale names -#ifdef _WIN32 - // WARNING: Windows does not support UTF-8 codepages. - // Locales are "converted" using https://docs.moodle.org/dev/Table_of_locales -# define LOCALE_en_US "en-US" -# define LOCALE_en_US_UTF_8 "en-US" -# define LOCALE_cs_CZ_ISO8859_2 "cs-CZ" -# define LOCALE_fr_FR_UTF_8 "fr-FR" -# define LOCALE_fr_CA_ISO8859_1 "fr-CA" -# define LOCALE_ru_RU_UTF_8 "ru-RU" -# define LOCALE_zh_CN_UTF_8 "zh-CN" +#define LOCALE_en_US "en_US" +#define LOCALE_en_US_UTF_8 "en_US.UTF-8" +#define LOCALE_fr_FR_UTF_8 "fr_FR.UTF-8" +#ifdef __linux__ +# define LOCALE_fr_CA_ISO8859_1 "fr_CA.ISO-8859-1" +# define LOCALE_cs_CZ_ISO8859_2 "cs_CZ.ISO-8859-2" +#elif defined(_WIN32) +# define LOCALE_fr_CA_ISO8859_1 "fr-CA" +# define LOCALE_cs_CZ_ISO8859_2 "cs-CZ" #else -# define LOCALE_en_US "en_US" -# define LOCALE_en_US_UTF_8 "en_US.UTF-8" -# define LOCALE_fr_FR_UTF_8 "fr_FR.UTF-8" -# ifdef __linux__ -# define LOCALE_fr_CA_ISO8859_1 "fr_CA.ISO-8859-1" -# define LOCALE_cs_CZ_ISO8859_2 "cs_CZ.ISO-8859-2" -# else -# define LOCALE_fr_CA_ISO8859_1 "fr_CA.ISO8859-1" -# define LOCALE_cs_CZ_ISO8859_2 "cs_CZ.ISO8859-2" -# endif -# define LOCALE_ru_RU_UTF_8 "ru_RU.UTF-8" -# define LOCALE_zh_CN_UTF_8 "zh_CN.UTF-8" +# define LOCALE_fr_CA_ISO8859_1 "fr_CA.ISO8859-1" +# define LOCALE_cs_CZ_ISO8859_2 "cs_CZ.ISO8859-2" #endif +#define LOCALE_ru_RU_UTF_8 "ru_RU.UTF-8" +#define LOCALE_zh_CN_UTF_8 "zh_CN.UTF-8" #include #include