From: short <> Date: Sat, 10 Sep 2005 07:30:29 +0000 (+0000) Subject: +Workaround &CGI::escapeHTML workaround of some browsers breaking: utf-8 X-Git-Url: http://git.jankratochvil.net/?a=commitdiff_plain;h=7fa54a9505c11529758016867fbdcdfe536bcd4d;hp=3b62e3657c71b5ee91280b70c7af35e01231e343;p=MyWeb.git +Workaround &CGI::escapeHTML workaround of some browsers breaking: utf-8 --- diff --git a/Web.pm b/Web.pm index 0616f94..872224e 100644 --- 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); }