We help IT Professionals succeed at work.

apostrophe in a URL name.(Trying not to encode it)

Wayne Barron
Wayne Barron asked
on
Hello, All.

I am trying my best to NOT have to encode the apostrophe in a URL name to this: Nothin%27_to_Lose.
I have tried to replace the apostrophe with a * or a Period, and when I do a Request.QueryString("Title") on this
Nothin*_to_Lose
It is replaced with
Nothin

What am I missing here?
Does the Request.QueryString() not work with these types of characters?

Wayne
Comment
Watch Question

Wayne BarronAuthor, Web Developer
CERTIFIED EXPERT
Top Expert 2009

Author

Commented:

Looking at a Wikipedia article.


Letters (AZ and az), numbers (09) and the characters '*','-','.' and '_' are left as-is

The octet corresponding to the tilde ("~") is permitted in query strings by RFC3986 but required to be percent-encoded in HTML forms to "%7E"


OK, with that. I SHOULD be able to use.
* asterisk
. Period

However, when I try, it cuts off everything from that character to the end.

I can use the _ and - without an issue.


I also checked the log files and there is nothing showing that would indicate it was not working.
It just will not work in a query.

Wayne BarronAuthor, Web Developer
CERTIFIED EXPERT
Top Expert 2009

Author

Commented:

ASP Classic website.

Author, Web Developer
CERTIFIED EXPERT
Top Expert 2009
Commented:

OK, I decided to replace the ' with -- double dashes.
Since I am the one inserting the names, I will know NOT to put in a word with double dashes in it manually.
So, with the URL, it will be
Nothin--_to_Lose
Then a replace
theName = replace(request.querystring("title"),"--","'")
This will, of course, change too.
Nothin'_to_Lose
And then, I send this to the variable for the query against the database, and it works great.

Have a good one.
Wayne