GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Badger::Codec::HTML(3) User Contributed Perl Documentation Badger::Codec::HTML(3)

Badger::Codec::HTML - encode and decode reserved characters in HTML

    use Badger::Codec::HTML;
    
    # class methods
    my $enc = Badger::Codec::HTML->encode("http://foo.com/bar.html");
    my $dec = $codec->decode($enc);
    
    # object methods
    my $codec = Badger::Codec::HTML->new();
    my $enc   = $codec->encode("http://foo.com/bar.html");
    my $dec   = $codec->decode($enc);

This module implements a subclass of Badger::Codec for encoding and decoding HTML. It is based on code extracted from Lincoln Stein's CGI.pm module.

The encode() method encodes HTML by converting any reserved characters to the correct HTML entities.

The decode() method reverses this process.

Encodes the HTML text passed as the first argument.

    $encoded = Badger::Codec::HTML->encode($html);

The optional second argument can be used to indicate the character set in use. If this is set to "ISO-8859-1" "WINDOWS-1252" then the encoded data will undergo some additional processing in order to work around some known bugs in Microsoft's web browsers. See fix_windows().

Decodes the encoded HTML text passed as the first argument.

    $html = Badger::Codec::HTML->decode($encoded);

This method is used internally to repair the damage caused by bugs in certain inferior browsers.

Andy Wardley <http://wardley.org/>

Copyright (C) 2005-2009 Andy Wardley. All rights reserved.

This code is derived from Lincoln D. Stein's CGI module.

Badger::Codec
2016-12-12 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.