]> git.nbdom.net Git - nb.git/commitdiff
charset testing
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Fri, 1 Dec 2023 15:52:49 +0000 (16:52 +0100)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Fri, 1 Dec 2023 15:52:49 +0000 (16:52 +0100)
lib/perl/NB/CGI.pm

index 6cff3e652ff96ae3711a7f162217226cf3e2392a..aec5d1b0f0f215fc64a7a56ebbd50f68d1726030 100644 (file)
@@ -1,15 +1,36 @@
+#
 # NB 22.11.23
-package NB::CGI;
+#
 use strict;
+package NB::CGI;
 #our $PARAM_UTF8 = 1 unless defined $PARAM_UTF8;
-#$CGI::PARAM_UTF8 = 1 unless defined $CGI::PARAM_UTF8;
+#use CGI qw(-utf8);
 use parent qw/CGI/;
+#use base qw/CGI/;
+#our @EXPORT_OK = @CGI::EXPORT_OK;
+#our @EXPORT = @CGI::EXPORT;
+#our @EXPORT= @CGI::EXPORT;
+#our @EXPORT_OK = @CGI::EXPORT_OK;
+# NB 01.12.23 BEGIN {
+  # NB 01.12.23 require CGI;
+  # NB 01.12.23 our @ISA;
+  # NB 01.12.23 push @ISA, qw(CGI);
+# NB 01.12.23 }
 $CGI::PARAM_UTF8 = 1;
 #$CGI::PARAM_UTF8 = 1 unless defined $CGI::PARAM_UTF8;
 #&CGI::init;
-&CGI::charset('utf-8') if $CGI::PARAM_UTF8;
+# NB 01.12.23 &CGI::charset('utf-8') if $CGI::PARAM_UTF8;
 my $NO_HEADERS = 0;
 
+sub new {
+       my $cgi = &CGI::new(@_);
+       #$cgi->_setup_symbols;
+       $CGI::PARAM_UTF8 = 1;
+       $cgi->charset('utf-8') if $CGI::PARAM_UTF8;
+       &CGI::charset($cgi->charset);
+       return $cgi;
+}
+
 my $isTextOutput = 0;
 sub textOutput {{
        no warnings 'redefine';
@@ -262,10 +283,10 @@ sub header {
   return join($CGI::CRLF,@head);
 }
 
-# NB 26.11.23 sub init {
-       # NB 26.11.23 &CGI::init;
-       # NB 26.11.23 &CGI::charset('utf-8') if $CGI::PARAM_UTF8;
-# NB 26.11.23 }
+# NB 01.12.23 sub init {
+       # NB 01.12.23 &CGI::charset('utf-8') if $CGI::PARAM_UTF8;
+       # NB 01.12.23 &CGI::init(@_);
+# NB 01.12.23 }
 
 sub start_html {
        local $_ = &CGI::start_html(@_);