Opened 12 years ago

Closed 11 years ago

#5009 closed Bugs (fixed)

read_info doesn't handle wistream correctly (isspace asserts)

Reported by: v.pruess Owned by: Sebastian Redl
Milestone: To Be Determined Component: property_tree
Version: Boost 1.41.0 Severity: Problem
Keywords: Cc:

Description

The following code works on GNU/Linux (g++ 4.2.4) but fails on Windows (XP/vc8) because the library function isspace called by the info-parser seems to include an additional check (i <= 255).

using namespace boost::property_tree ;
wptree pt ;

std::wfstream fs( "any_utf8_encoded_file.info" ) ;
fs.imbue( std::locale( std::locale(), new boost::utf8_codecvt_facet ) );

read_info( fs, pt ) ;

I replaced the call to the single-argument-version of isspace with the locale-aware version which results in a running solution but in consequence nearly every method in info_parser_read.hpp got as an additional parameter a reference to the stream. Maybe there is a more elegant solution.

See also comments in boost/tuple/tuple_io.hpp.

Change History (4)

comment:1 by Marshall Clow, 12 years ago

Can you tell me why you think this is a regression?

To me, that means "it used to work, and now it is broken", and that doesn't seem to fit the description here.

comment:2 by anonymous, 12 years ago

Severity: RegressionProblem

in reply to:  1 comment:3 by v.pruess, 12 years ago

Replying to marshall:

Can you tell me why you think this is a regression?

To me, that means "it used to work, and now it is broken", and that doesn't seem to fit the description here.

Sorry, this was clearly misleading. I changed the Severity to Problem because I never observed this feature as working.

comment:4 by Sebastian Redl, 11 years ago

Resolution: fixed
Status: newclosed

Fixed in r71994 to not crash. That doesn't mean it really recognizes Unicode whitespace.

Note: See TracTickets for help on using tickets.