From feb138022ef18fb4bfa8fcf61482a1b4ea6de94e Mon Sep 17 00:00:00 2001 From: b Date: Tue, 30 May 2023 22:25:30 +0000 Subject: [PATCH] html entity decoding --- botm-common | 2 +- sendpost.1.pl | 25 ++++++++++++++++++------- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/botm-common b/botm-common index b32a014..5eb6fff 160000 --- a/botm-common +++ b/botm-common @@ -1 +1 @@ -Subproject commit b32a014fe5391f7557580eb2e1263e2f8e7bfc94 +Subproject commit 5eb6fff2ecca3f68b44aeffcfaf10663a9e72502 diff --git a/sendpost.1.pl b/sendpost.1.pl index 49b9ef5..f1bd7fc 100644 --- a/sendpost.1.pl +++ b/sendpost.1.pl @@ -25,7 +25,7 @@ use botm_common ( 'read_data_file', 'write_data_file', 'url_encode', 'url_decode', 'join_path', - 'html_entity_encode_dec', 'html_entity_encode_hex' + 'html_entity_decode' ); ###PERL_ENCODING_FILE_IN: use constant ENCODING_FILE_IN => 'UTF-8'; @@ -103,12 +103,23 @@ GetOptions ( 'help|h' => \$options{ 'help'} ); -print html_entity_encode_dec('')."\n"; -print html_entity_encode_dec('', '', 1)."\n"; -print html_entity_encode_dec('', 'UTF-8', 1)."\n"; -print html_entity_encode_hex('')."\n"; -print html_entity_encode_hex('', '', 1)."\n"; -print html_entity_encode_hex('', 'UTF-8', 1)."\n"; +print html_entity_decode( + 'illegal: "&" -' . "\n". + 'name(gt): ">" -' . "\n". + 'name_inf(gta): ">a" -' . "\n". + 'decimal(126): "~" -' . "\n". + 'hexadecimal(7E). "~" -' . "\n". + 'bad names: Y;&enhedksdh; -' . "\n". + 'finally, some text :> -' +)."\n"; + + +# print html_entity_encode_dec ('')."\n"; +# print html_entity_encode_hex ('')."\n"; +# print html_entity_encode_name('')."\n"; +# print html_entity_encode_dec ('', 1)."\n"; +# print html_entity_encode_hex ('', 1)."\n"; +# print html_entity_encode_name('', 1)."\n"; exit 0; if ($options{'help'} ne '') { -- 2.30.2