EString ImapUrlParser::xchars( bool b ) { EString s; char c = nextChar(); while ( c != '\0' ) { if ( unreserved( c ) || ( c == '&' || c == '=' || c == '~' ) || ( b && ( c == ':' || c == '@' || c == '/' ) ) ) { // Nasty hack: we won't eat the beginning of "/;UID". if ( b && c == '/' && str[pos()+1] == ';' ) break; s.append( c ); step(); } else if ( c == '%' && escape( &c ) ) { s.append( c ); } else { break; } c = nextChar(); } return s; }
//static std::string LLURI::escape(const std::string& str) { static std::string default_allowed = unreserved(); static bool initialized = false; if(!initialized) { std::sort(default_allowed.begin(), default_allowed.end()); initialized = true; } return escape(str, default_allowed, true); }