Message::CGI::Util
use Message::CGI::Util qw(htescape percent_encode);
print htescape "ab < cd";
print q<http://www.example.com/> . percent_encode "\x{4e00} = 1";
The Message::CGI::Util
module provides various functions which are particulary useful in CGI scripts.
Functions are not exported by default. You have to explicitly import functions you'd like to use as:
use Message::CGI::Util qw(function1 function2 ...);
Escapes the given string for the use in HTML/XML markups.
Percene-encodes the given character string. Characters are encode in utf8
and then percent-encoded. Any character other than RFC 3986's unreserved
characters are encoded.
Percent-encodes the given character string. It works as percent_encode
does, except that this function only encodes non-ASCII characters. Reserved ASCII characters are not encoded.
Percent-decodes the given byte string and then decoded as UTF-8.
Resolves the relative reference against the given base URL and returns the RFC 3986 absolute URI.
Formats the given time in the "date or time strings in content" format defined in earlier drafts of the Web Applications 1.0 specification.
Formats the given time in the RFC 1123 format defined in the RFC 2616 (HTTP/1.1).
The URL::PercentEncode module provides more comprehensive set of functions to percent-encode or percent-decode strings. The module is available from <https://suika.suikawiki.org/gate/git/wi/perl/webutils.git>
.
Wakaba <wakaba@suikawiki.org>
Copyright 2008-2010 Wakaba <wakaba@suikawiki.org>
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.