Here's a potential Regex you could use to accomplish the encoding.
Regex.Replace(s, @"[^\w]", m => "%" + ((int)m.Value[0]).ToString("X2"));
I'm not sure that there is an existing framework method defined to strictly encode all non-alphanumeric characters that you could point your clients to.