method service at a time"â„¢">
Ray Jezek's Blog"defying logic, one method service at a time"â„¢HttpUtility.UrlEncode Does not encode spaces properly- January 14, 2005 I realized a while back that HttpUtility.UrlEncode does not properly encode spaces for URLs. It encodes a space as a &8220;+&8220; which most browsers do not interpret as a space for the obvious reason that + is actually a valid character for a filename. So to work around the bug we wrote the following: public static string URLEncode(string str) return System.Web.HttpUtility.UrlEncode( str ).Replace("+","%20"); It's interesting to note...http://blogs.geekdojo.net/jez/archive/2005/01/14/6462.aspx My Nerd Score- January 5, 2005 Well since ryan took it I had to. It's actually about where i thought i would be. Just your average nerd.http://blogs.geekdojo.net/jez/archive/2005/01/05/5893.aspx |