Closed sehe closed 5 years ago
The following assert fails:
#include <boost/spirit/home/x3.hpp> int main() { namespace x3 = boost::spirit::x3; char const* input = "\x80"; assert(!x3::parse(input, input+1, x3::ascii::char_)); }
The assert should pass because char_encoding::ascii::test disallows non-7bit ASCII, so "\x80" is outside the encoding.
char_encoding::ascii::test
"\x80"
The corresponding Qi test case DOES pass:
#include <boost/spirit/include/qi.hpp> int main() { namespace qi = boost::spirit::qi; char const* input = "\x80"; assert(!qi::parse(input, input+1, qi::ascii::char_)); }
As noticed on stackoverflow https://stackoverflow.com/questions/56916592/spirit-x3-how-to-fail-parse-on-non-ascii-input
Created a merge request the most logical fix, https://github.com/boostorg/spirit/pull/521
Should not break any tests
merged.
The following assert fails:
The assert should pass because
char_encoding::ascii::test
disallows non-7bit ASCII, so"\x80"
is outside the encoding.The corresponding Qi test case DOES pass:
As noticed on stackoverflow https://stackoverflow.com/questions/56916592/spirit-x3-how-to-fail-parse-on-non-ascii-input