$group = lc($1);
my $comment = $2;
$res->{$section}->{$group} = [];
- $res->{group_comments}->{$group} = $comment if $comment;
+ $res->{group_comments}->{$group} = decode('utf8', $comment)
+ if $comment;
next;
}
$group = lc($1);
my $comment = $2;
$res->{$section}->{$group} = [];
- $res->{ipset_comments}->{$group} = $comment if $comment;
+ $res->{ipset_comments}->{$group} = decode('utf8', $comment)
+ if $comment;
next;
}
foreach my $ipset (sort keys %{$cluster_conf->{ipset}}) {
if (my $comment = $cluster_conf->{ipset_comments}->{$ipset}) {
- $raw .= "[IPSET $ipset] # $comment\n\n";
+ my $utf8comment = encode('utf8', $comment);
+ $raw .= "[IPSET $ipset] # $utf8comment\n\n";
} else {
$raw .= "[IPSET $ipset]\n\n";
}
foreach my $group (sort keys %{$cluster_conf->{groups}}) {
my $rules = $cluster_conf->{groups}->{$group};
if (my $comment = $cluster_conf->{group_comments}->{$group}) {
- $raw .= "[group $group] # $comment\n\n";
+ my $utf8comment = encode('utf8', $comment);
+ $raw .= "[group $group] # $utf8comment\n\n";
} else {
$raw .= "[group $group]\n\n";
}