For Programmers: Free Programming Magazines  


Home > Archive > PERL Miscellaneous > June 2005 > I'm creating a URL









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author I'm creating a URL
socialism001@yahoo.com

2005-06-09, 3:57 am

I'm creating a URL to paste into a html page that the user can click
on. Does anyone know of any programs that will automatically convert
spaces and other special characters into url compatible code. I think
space is %20

i.e. I need to be able to type in
'http://mysite.com/prog.pl?stuff&description=properties that fit this
requirement&date=20050517&itemcode=june0805

so the spaces after the description would need to be converted.

Thanks,
Chris

A. Sinan Unur

2005-06-09, 3:57 am

socialism001@yahoo.com wrote in news:1118281637.466346.313280
@f14g2000cwb.googlegroups.com:

> I'm creating a URL to paste into a html page that the user can click
> on. Does anyone know of any programs that will automatically convert
> spaces and other special characters into url compatible code.


Didn't you find something suitable when you searched/browsed through CPAN?

Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(reverse each component and remove .invalid for email address)

comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/c...guidelines.html
Christopher Nehren

2005-06-09, 3:57 am

On 2005-06-09, socialism001@yahoo.com scribbled these
curious markings:
> I'm creating a URL to paste into a html page that the user can click
> on. Does anyone know of any programs that will automatically convert
> spaces and other special characters into url compatible code. I think
> space is %20


This is in the FAQ (which I actually didn't know until a short while
ago, as it was posted to the group). perlfaq9 has your answer. If you
have access to a system with a command-line and a proper perl
installation (instead of the butchered installations which certain
unnamed Linux distributions use by default), you should be able to
obtain the answer by doing:

perldoc -q '%-'

Change the '' as appropriate for your shell's quoting rules.

Best Regards,
Christopher Nehren
--
I abhor a system designed for the "user", if that word is a coded
pejorative meaning "stupid and unsophisticated". -- Ken Thompson
If you ask the wrong people questions, you get "Joel on Software".
Unix is user friendly. However, it isn't idiot friendly.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com