At 16:33 -0500 08/12/1999, w e b s l a v e wrote: >I need to encode a string so it's url friendly, replacing spaces with '%20' >and slashes '/' with '%C4' etc... > >I've got this bit that DEcodes... > > $value =~ tr/+/ /; > $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; > $value =~ s/~!/ ~!/g; > >But, I'm stuck on how to do it in reverse to ENcode the string... > >I'd appreciate any help! (Thanks!) If you're writing a CGI script using CGI.pm you can use the escape(), unescape(), and escapeHTML() functions. If you're not using CGI.pm (why not? :-) or not writing a CGI script, you might look at the implementation of these functions within CGI.pm. - Vicki -- -- |\ _,,,---,,_ Vicki Brown <vlb@cfcl.com> ZZZzz /,`.-'`' -. ;-;;,_ Journeyman Sourceror: Scripts & Philtres |,4- ) )-,_. ,\ ( `'-' P.O. Box 1269 San Bruno CA 94066 '---''(_/--' `-'\_) http://www.cfcl.com/~vlb http://www.macperl.com ===== Want to unsubscribe from this list? ===== Send mail with body "unsubscribe" to macperl-request@macperl.org