Changeset 16672
- Timestamp:
- 2008-08-07T13:52:36+12:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gsdl/trunk/perllib/unicode.pm
r16553 r16672 544 544 } 545 545 546 547 546 # Returns true (1) if the given string is utf8 and false (0) if it isn't. 548 547 # Does not modify the string parameter. … … 577 576 } 578 577 578 sub url_encode { 579 my ($text) = @_; 580 $text =~ s/([^A-Z0-9\.\-\_])/sprintf("%%%02X", ord($1))/iseg; 581 # URL_encode spaces too? 582 #$text =~ s/ /%20/sg; 583 return $text; 584 } 585 586 sub url_decode { 587 my ($text) = @_; 588 589 $text =~ s/\%([A-F0-9]{2})/pack('C', hex($1))/ige; 590 return $text; 591 } 592 579 593 sub substr 580 594 {
Note:
See TracChangeset
for help on using the changeset viewer.