Skip to content

Commit

Permalink
Workaround stdlib issues with toupper on FreeBSD
Browse files Browse the repository at this point in the history
In the en_US.ISO8859-1 'ç' and 'Ç' should be case-converted into each
other but on FreeBSD this doesn't seem to happen.
This isn't a bug in our library so just detect this.
  • Loading branch information
Flamefire committed Feb 8, 2024
1 parent f17ce62 commit 097696d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion test/test_std_convert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,16 @@ void test_char()
std::cout << "Testing " << name << std::endl;
l = gen(name);
test_one<CharType>(l, "Hello World", "hello world", "HELLO WORLD");
test_one<CharType>(l, "Façade", "façade", "FAÇADE");
#if BOOST_LOCALE_USE_WIN32_API
name = "English_United States";
#endif
// Check that ç can be converted to Ç by the stdlib (fails on e.g. FreeBSD libstd++)
if(std::toupper('\xe7', std::locale(name)) == '\xc7')
test_one<CharType>(l, "Façade", "façade", "FAÇADE");
else {
std::cout << "- en_US.ISO8859-1 (" << name << ") not well supported. "; // LCOV_EXCL_LINE
std::cout << "Skipping conv test" << std::endl; // LCOV_EXCL_LINE
}
boost::locale::case_convert_test::test_no_op_title_case<CharType>(l, "Hello world i");
} else
std::cout << "- en_US.ISO8859-1 is not supported, skipping" << std::endl; // LCOV_EXCL_LINE
Expand Down

0 comments on commit 097696d

Please sign in to comment.