Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

global locale from boost make std::regex fail on FreeBSD with libc++ #36

Closed
schorsch1976 opened this issue Dec 21, 2018 · 1 comment
Closed

Comments

@schorsch1976
Copy link

This is a dependent of
#35
but with more concentrated and more distilled information.

bug.txt
result-csv.ods.tar.gz

The regex fails if one of this facets is set:
"all_characters , collation_facet, all_categories".

boost::locale::generator gen;

// all_characters , collation_facet, all_categories trigger the bug",
gen.categories(collation_facet);
std::locale loc{ gen("de_DE.UTF-8") };
std::locale::global(loc);

std::regex re_datetime("^Date\\s*:[\\s\\t]*(\\d{4}\\-\\d{2}\\-\\d{2} "
						"\\d{2}:\\d{2}:\\d{2}?)$",
						std::regex_constants::icase);
std::smatch match;
if (std::regex_match(test, match, re_datetime) && match.size() > 1)
	std::cout << "All ok" << std::endl;
else
	std::cout << "Bug triggered" << std::endl;

I setup a testprogram that tries every locale (192),every facet(12(no wchar_t on freebsd)), every backend(std/icu/posix) and icase on/off.

The pivot analysis of the result shows, this happens on every locale (except posix/C) with facet "all_characters , collation_facet, all_categories".

This happens only on FreeBSD with clang and libc++.

@Flamefire
Copy link
Collaborator

Flamefire commented Jan 12, 2025

Closing in favor of newer issue #249

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants