Re: [cgi-devel] post data with illegal characters
Status: Beta
Brought to you by:
drrngrvy
From: <jc...@ol...> - 2010-11-02 13:11:31
|
> Hello, > > Some of my POST variable are been added illegal characters at the end. > > 1986^@^@^@^@^@ > > insead of > 1986 APplying the following function: void remove_non_graph(std::string& str) { for(std::string::iterator i=str.end()-1; i>=str.begin(); --i) { if ( !isalnum(*i) && !isgraph(*i) ) { str.erase(i); } } } to a variable fixes the issue. Do you think this is a solid patch? If so, where in the source codes, should I add it so that all the variables are cleaned this way? Thanks! > > to read those data I am using: > > for(typename Map::const_iterator i = m.begin(); i != m.end(); ++i) > { > os << i->first << " = " << i->second << "\n"; > } > and > > req.post.pick("task","default"); > > with the illegal characters been added in both cases. > >>From the html, I don't see any reason why that would happen. > > Any idea on how I could fix this problem? > > Thanks you > > > ------------------------------------------------------------------------------ > Nokia and AT&T present the 2010 Calling All Innovators-North America > contest > Create new apps & games for the Nokia N8 for consumers in U.S. and Canada > $10 million total in prizes - $4M cash, 500 devices, nearly $6M in > marketing > Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store > http://p.sf.net/sfu/nokia-dev2dev > _______________________________________________ > cgi-devel mailing list > cgi...@li... > https://lists.sourceforge.net/lists/listinfo/cgi-devel > |