UTF shenanigans, yey 9_9

This commit is contained in:
Chris 2011-10-31 13:52:14 +00:00
parent 4c319fa108
commit 3d8eb96fc4

View File

@ -36,7 +36,7 @@ package Block;
use HTMLValidator;
use Utils qw(is_defined_numeric);
use Encode;
use HTML::Entities;
use strict;
@ -120,6 +120,7 @@ sub validate_string {
# Grab the parameter value, fall back on the default if it hasn't been set.
my $text = $self -> {"cgi"} -> param($param);
$text = Encode::decode("utf8", $text) if(!Encode::is_utf8($text));
# Handle the situation where the parameter has not been provided at all
if(!defined($text) || $text eq '' || (!$text && $settings -> {"nonzero"})) {