private static bool _UrlEncodeIsSafe(byte b) { if (Utility._IsAsciiAlphaNumeric(b)) { return(true); } if (b != 33) { switch (b) { case 39: case 40: case 41: case 42: case 45: case 46: return(true); case 43: case 44: break; default: if (b == 95) { return(true); } break; } return(false); } return(true); }
private static bool _UrlEncodeIsSafe(byte b) { if (Utility._IsAsciiAlphaNumeric(b)) { return(true); } char chr = (char)b; if (chr != '!') { switch (chr) { case '\'': case '(': case ')': case '*': case '-': case '.': { break; } case '+': case ',': { return(false); } default: { if (chr != '\u005F') { return(false); } else { break; } } } } return(true); }