+Workaround &CGI::escapeHTML workaround of some browsers breaking: utf-8
authorshort <>
Sat, 10 Sep 2005 07:30:29 +0000 (07:30 +0000)
committershort <>
Sat, 10 Sep 2005 07:30:29 +0000 (07:30 +0000)
Web.pm

diff --git a/Web.pm b/Web.pm
index 0616f94..872224e 100644 (file)
--- a/Web.pm
+++ b/Web.pm
@@ -97,6 +97,7 @@ BEGIN
 
 use WebConfig; # see also below: Wuse 'WebConfig';
 require CGI;   # for &escapeHTML
+CGI::charset("utf-8"); # Prevent &CGI::escapeHTML breaking utf-8 like \xC4\x9B eq \x{11B}
 require Image::Size;   # for &imgsize
 use File::Basename;    # &basename
 use Carp qw(cluck confess);
@@ -253,6 +254,7 @@ my($text)=@_;
        # Use &eval to prevent: Global $r object is not available. Set:\n\tPerlOptions +GlobalRequest\nin ...
        # CGI requires valid "r": check it beforehand here.
        confess "Calling dynamic URL generator from a static code" if !eval { Apache2::RequestUtil->request(); };
+       # See also somewhere else: CGI::charset("utf-8");
        return CGI::escapeHTML($text);
 }