[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] Encode string




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!)


Pete

(in UserTalk I would just use string.urlEncode to do it...)


===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org