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)
follow-up: 3 comment:1 by , 12 years ago
comment:2 by , 12 years ago
Severity: | Regression → Problem |
---|
comment:3 by , 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 , 11 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Fixed in r71994 to not crash. That doesn't mean it really recognizes Unicode whitespace.
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.