Question

boost::spirit asserts at boost::spirit::char_class::ascii::isalnum()

when passing ascci characters > 127.

I changed all my private variables from std::string to a

typedef std::basic_string<unsigned char, std::char_traits<unsigned char>, std::allocator<unsigned char> >
 u_string;

but still boost uses std:.string internally. What do i have to do ?

Was it helpful?

Solution

The solution is quite simple:

instead of

using namespace boost::spirit::ascii;

i now use

using namespace boost::spirit::iso8859_1;

This recognizes all charcters in the iso8859 character set.

OTHER TIPS

The problem is of course that there are no ASCII characters above 127. The interpretation of byte=8 bit is more recent than that.

If you're using ISO8859-1 or UTF-8 as a character encoding, you should configure your compiler correctly. This option micht be called " default char unsigned" or something like that, to reflect the fact that ISO-8859 does use character values above 127.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top