Gossamer Forum
Home : Products : Links 2.0 : Customization :

How do I remove ASCII code in URLs?

Quote Reply
How do I remove ASCII code in URLs?
I have the category C++ in my links database, and whenever I build the pages, the url in the HTML shows up something link this C_and_C%2B%2B/ My question is, how do I change the two "%2B" with a simple "+"?
Quote Reply
Re: How do I remove ASCII code in URLs? In reply to
Maybe you can use the HTML character code?

A plus sign is: & #43;


oops! Duh...the board naturally displayed it as a plus sign! Take the space out between the & and # signs.

[This message has been edited by Brad Richardson (edited June 27, 1999).]
Quote Reply
Re: How do I remove ASCII code in URLs? In reply to
Brad,

I'm not really sure that I understand. Would I put &#43 in the new category name in the admin area?

Example:
CGI/C_and_C&#43&#43
Quote Reply
Re: How do I remove ASCII code in URLs? In reply to
Try to use the HTML codes within the new category name.

e.g., CGI/C_and_C& #43;& #43;

It should work.

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: How do I remove ASCII code in URLs? In reply to
That didn't work either. Here's an example of what I have in the nph-build.cgi

my $chrs = quotemeta ("/\+_-");

Here's what I have in the category.def:

^[\w\d/\+_-]+$']

Is this what I should have?
Quote Reply
Re: How do I remove ASCII code in URLs? In reply to
It looks right. But try moving the \+ to the beginning of each list (just before the /). For some reason, there seems to be problems otherwise.

[This message has been edited by Bobsie (edited June 28, 1999).]
Quote Reply
Re: How do I remove ASCII code in URLs? In reply to
That didn't work. When I tried to add it in the admin, it wouldn't allow me to add it because it contained invalid charaters. So I added the characters in the category.def and nph-build.cgi. It accepted the new category, but when I built the pages it did the same thing. The ASCII text was in the linked URL form the homepage.

Quote Reply
Re: How do I remove ASCII code in URLs? In reply to
Chris,

I don't know if this will help, but you might want to try the "special characters in category" fix found at the following thread.
http://www.gossamer-threads.com/...um3/HTML/001722.html

Phoenix
Quote Reply
Re: How do I remove ASCII code in URLs? In reply to
phoenix,

Thanks, I've already seen that post. That's where I learned how to edit the category.def and nph-build.cgi to allow special characters. But I'm still having the problem where it builds the page with the url as C_and_C%2B%2B/

Look at:
http://www.webmastersonly.com/CGI/ and click on C and C++. It will bring you to the page where the url is C_and_C%2B%2B/

Quote Reply
Re: How do I remove ASCII code in URLs? In reply to
Have you tried adding the special characters you want to use as escaped characters? For example, in links.def and nph-build.cgi, put in "\+" (minus the quotes). I think that will allow the characters but I do believe you might run into problems later when searching. Someone did that with the & character.
Quote Reply
Re: How do I remove ASCII code in URLs? In reply to
hmmm.... That didn't work either.
Quote Reply
Re: How do I remove ASCII code in URLs? In reply to
I am out of ideas to try. Perhaps Alex knows.
Quote Reply
Re: How do I remove ASCII code in URLs? In reply to
Geez! I just found this while looking for something completely different. Now why couldn't I have stumbled on this 3 days ago?

I haven't tried it, but I think your problem is coming from db_utils.pl, sub urlencode. I betcha if you add your + to this list: [^a-zA-Z0-9_\-.] it will stop getting encoded. This might be a problem for some browsers, but a + in a URL works fine on Netscape and MSIE 3 and better.

I hope this finally fixes it!
Phoenix

[This message has been edited by phoenix (edited June 29, 1999).]