#!/usr/local/bin/perl -w my $version="0.1 (beta)"; # Copyright (C) 1999 Axel Beckert # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # You can reach the author by snail-mail at the following address: # # Axel Beckert # Saarbrücker Straße 267a # D-66125 Saarbrücken, Germany # Scrambles HTML-Files by replacing each character by its entity. # Blows files up by approximately factor 4. Use gzip or bzip2 to # compress files back to normale size... :-) # # Parameter -a scrambles also space characters like blank, tab and # newline. # Example: # # * Before: # Test # This is a test! # # # * After: # Test # This is a test! # my $text=""; my $all=0; if((0){$text.=$_;} $text=~s/&/&/g; $text=~s/>/>/g; $text=~s/</</g; $text=~s/ä/ä/g; $text=~s/Ä/Ä/g; $text=~s/ö/ö/g; $text=~s/Ö/Ö/g; $text=~s/ü/ü/g; $text=~s/Ü/Ü/g; $text=~s/ß/ß/g; $text=~s/à/à/g; $text=~s/À/À/g; $text=~s/á/á/g; $text=~s/Á/Á/g; $text=~s/â/â/g; $text=~s/Â/Â/g; $text=~s/ã/ã/g; $text=~s/Ã/Ã/g; $text=~s/å/å/g; $text=~s/Å/Å/g; $text=~s/æ/æ/g; $text=~s/Æ/Æ/g; $text=~s/è/è/g; $text=~s/È/È/g; $text=~s/é/é/g; $text=~s/É/É/g; $text=~s/Ê/Ê/g; $text=~s/ê/ê/g; $text=~s/ë/ë/g; $text=~s/Ë/Ë/g; $text=~s/ì/ì/g; $text=~s/Ì/Ì/g; $text=~s/í/í/g; $text=~s/Í/Í/g; $text=~s/î/î/g; $text=~s/Î/Î/g; $text=~s/ï/ï/g; $text=~s/Ï/Ï/g; $text=~s/ò/ò/g; $text=~s/Ò/Ò/g; $text=~s/ó/ó/g; $text=~s/Ó/Ó/g; $text=~s/ô/ô/g; $text=~s/Ô/Ô/g; $text=~s/õ/õ/g; $text=~s/Õ/Õ/g; $text=~s/ø/ø/g; $text=~s/Ø/Ø/g; $text=~s/Ù/Ù/g; $text=~s/ù/ù/g; $text=~s/Ú/Ú/g; $text=~s/ú/ú/g; $text=~s/Û/Û/g; $text=~s/û/û/g; $text=~s/Ñ/Ñ/g; $text=~s/ñ/ñ/g; $text=~s/Ç/Ç/g; $text=~s/ç/ç/g; $text=~s/ý/ý/g; $text=~s/ÿ/ÿ/g; $text=~s/Ð/Ð/g; $text=~s/ð/ð/g; $text=~s/Þ/Þ/g; $text=~s/þ/þ/g; $text=~s/±/±/g; $text=~s/·/·/g; $text=~s/­/­/g; $text=~s/×/×/g; $text=~s/÷/÷/g; $text=~s/¦/¦/g; $text=~s/¬/¬/g; $text=~s/¡/¡/g; $text=~s/¿/¿/g; $text=~s/¢/¢/g; $text=~s/£/£/g; $text=~s/¤/¤/g; $text=~s/¥/¥/g; $text=~s/¹/¹/g; $text=~s/²/²/g; $text=~s/³/³/g; $text=~s/¼/¼/g; $text=~s/½/½/g; $text=~s/¾/¾/g; $text=~s/´/´/g; $text=~s/¸/¸/g; $text=~s/¨/¨/g; $text=~s/¯/¯/g; $text=~s/°/°/g; $text=~s/º/º/g; $text=~s/ª/ª/g; $text=~s/¶/¶/g; $text=~s/§/§/g; $text=~s/µ/µ/g; $text=~s/©/©/g; $text=~s/®/®/g; $text=~s/»/»/g; $text=~s/«/«/g; $text=~s/([>;])(([^<>&;]|[^&]{3,7};|&[^;]{3,7})+)([&<])/$1. join('',map{if((!m!\s!) || $all){$_=sprintf("&#%03d;",ord$_);} else{ $_; }}split('',$2)).$4/gem; $text=~s/(<[^<>]+=\")([^\"]+)(\"[^<>]*>)/$1. join('',map{$_=sprintf("&#%03d;",ord$_);}split('',$2)).$3/ges; print $text;