Opened 10 years ago

#1798 new Bugs

met an error using boost::tokenizer in multi-times in vs2005, unicode

Reported by: wingo <wangtonggu@…> Owned by: jsiek
Milestone: Component: tokenizer
Version: Boost 1.34.1 Severity: Problem
Keywords: boost::tokenizer Cc:


test function:

const CHAR* tnotifymsg = “HTTP/1.1 Host: Content-Length: 110 Date : ......

<?xml version="1.0"?> <Encodeing>

<Body cls="auto" obj="10001">


</ Encodeing >”;

CHAR* pSeparator = " ,;\n\r";

int nErrorcode = 0;

boost::char_separator<CHAR> sep(pSeparator); std::string strNotifymsg = tnotifymsg; boost::tokenizer<boost::char_separator<CHAR>> tokens(strNotifymsg, sep);

boost::tokenizer<boost::char_separator<CHAR>>::iterator itBegin = tokens.begin();

boost::tokenizer<boost::char_separator<CHAR>>::iterator itEnd = tokens.end();

boost::tokenizer<boost::char_separator<CHAR>>::iterator beg = itBegin;

error code if "HTTP/1.1" at the beginning of notify message if(_stricmp((*beg).c_str(), "HTTP/1.1") == 0) {

using boost::lexical_cast; ++beg; nErrorcode = lexical_cast<int>(*beg);

return nErrorcode;

} else{

else the right message for parser for(; !bFinishFlag; ++beg) {




Attachments (0)

Change History (0)

Modify Ticket

Change Properties
Set your email in Preferences
as new The owner will remain jsiek.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.