[Boost-bugs] [Boost C++ Libraries] #9105: boost::tokenizer fails if string contains percent signs

Subject: [Boost-bugs] [Boost C++ Libraries] #9105: boost::tokenizer fails if string contains percent signs
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-09-12 07:03:45


#9105: boost::tokenizer fails if string contains percent signs
------------------------------+-----------------------
 Reporter: anonymous | Owner: jsiek
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: tokenizer
  Version: Boost 1.54.0 | Severity: Problem
 Keywords: |
------------------------------+-----------------------
 [Visual Studio 2010]
 Let's use as an example code shown on the bottom of the page
 http://www.boost.org/doc/libs/1_54_0/libs/tokenizer/escaped_list_separator.htm

 =====>>>>
 // simple_example_2.cpp
 #include<iostream>
 #include<boost/tokenizer.hpp>
 #include<string>

 int main(){
    using namespace std;
    using namespace boost;
    string s = "Field 1,\"putting quotes around fields, allows
 commas\",Field 3";
    tokenizer<escaped_list_separator<char> > tok(s);
    for(tokenizer<escaped_list_separator<char> >::iterator beg=tok.begin();
 beg!=tok.end();++beg){
        cout << *beg << "\n";
    }
 }
 <<<<=====

 Works fine.

 Let's insert percent sign somewhere inside string s.
 As an example
 s = "Field 1,\"putting q%uotes around fields, allows commas\",Field 3";

 program fails with:
 First-chance exception at 0x75c4c41f in test.exe: Microsoft C++ exception:
 boost::escaped_list_error at memory location 0x007cf060..

 It fails even percent sign would be followed by hex code (like %20)

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/9105>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:14 UTC