string Encoding::encodeURL(const utf8string &str){ string encoded; for(auto &it=str.begin();it!=str.end();++it){ if( isprint(*it) ) encoded += *it; else{ char tmp[40]; sprintf(tmp, "%%%02X", *it); encoded += tmp; } } return encoded; }