Home Dashboard Directory Help
Search

Error in documentation for HttpServerUtility.UrlPathEncode by OwyheeRover


Status: 

Closed
 as By Design Help for as By Design


2
0
Sign in
to vote
Type: Bug
ID: 551839
Opened: 4/16/2010 8:43:28 AM
Access Restriction: Public
0
Workaround(s)
view
0
User(s) can reproduce this bug

Description

The documenation for HttpServerUtility.UrlPathEncode at http://msdn.microsoft.com/en-us/library/system.web.httpserverutility.urlpathencode.aspx says

Characters such as a question mark (?), ampersand (&), slash mark (/), and spaces might be truncated or corrupted by some browsers. As a result, these characters must be encoded in <a> tags or in query strings where the strings can be re-sent by a browser in a request string.

To me, this says that question marks are encoded, especially those inside <a> tags. Yet the example given, and real-life practice, show that the question mark is not encoded.

Details
Sign in to post a comment.
Posted by OwyheeRover on 4/27/2010 at 11:45 AM
Please add to the documentation of UrlPathEncode to include a discussion of UrlEncode. Note that this would then be consistent with the documentation for UrlEncode, which does discuss UrlPathEncode. However, currently, if one reads about UrlPathEncode, they would not readily understand that perhaps they should also learn about UrlEncode.

Thanks.
Posted by Microsoft on 4/27/2010 at 10:34 AM
UrlPathEncode has historically only Url encoded values < 0x20 or >= 0x7F. It also includes logic that first splits the input string on '?' since it assumes everything after the '?' is a query-string that has already been encoded.

UrlEncode is more aggressive than UrlPathEncode and will Url encode characters like '?'. The UrlEncode method also doesn't make any assumptions about embedded '?' having any significance.

Thank you for submitting your issue on Connect.
Posted by Microsoft on 4/18/2010 at 10:51 PM
Thanks for your feedback. We were able to reproduce the issue you are seeing. We are routing this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by Microsoft on 4/18/2010 at 10:51 PM
Thanks for your feedback. We were able to reproduce the issue you are seeing. We are routing this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by Microsoft on 4/18/2010 at 10:51 PM
Thanks for your feedback. We were able to reproduce the issue you are seeing. We are routing this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Sign in to post a workaround.