Boost logo

Boost :

From: Anjaly (anjaly_at_[hidden])
Date: 2007-09-27 02:06:39


Hello,

I am new to Boost-regex library. The libray is build with icu
support.The user interface is created using wxWidgets library. I want to
search a file using u32regex_search. But the program crashes and the
error it shows is 'Invalid UTF-8 sequence encountered while trying to
encode UTF-32 character'.I am reading the contents of the file and it is
stored in char array.The program is crashing when it encounters a char
with hex value 00.

wxString s=SearchTxt->GetValue();
   
const char *start=(const char*)buffer;
const char *end=(const char*)buffer+len;

boost::cmatch what;

boost::u32regex e1= boost::make_u32regex(s.fn_str(),
boost::regex::icase);

 while(boost::u32regex_search(start,end, what,e, boost::match_default))
{
 cout << what[0] << "\n";
}

______________________________________
Scanned and protected by Email scanner


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk