$self->set_options(@_) if (@_);
- $self->_init_escaped_strings_map();
-
return $self;
}
-sub _init_escaped_strings_map {
- my $self = shift;
-
- $self->{escaped_strings_map} = {
- 'ä' => 'ä',
- 'ö' => 'ö',
- 'ü' => 'ü',
- 'Ä' => 'Ä',
- 'Ö' => 'Ö',
- 'Ü' => 'Ü',
- 'ß' => 'ß',
- '>' => '>',
- '<' => '<',
- '"' => '"',
- };
-
- my $iconv = $main::locale->{iconv_iso8859};
-
- if ($iconv) {
- map { $self->{escaped_strings_map}->{$_} = $iconv->convert($self->{escaped_strings_map}->{$_}) } keys %{ $self->{escaped_strings_map} };
- }
-}
-
sub set_columns {
my $self = shift;
my %columns = @_;
my $self = shift;
my $value = shift;
- $value = $self->{form}->quote_html($value);
+ $value = $main::locale->quote_special_chars('HTML', $value);
$value =~ s/\r//g;
$value =~ s/\n/<br>/g;
}
sub unescape_string {
- my $self = shift;
- my $text = shift;
-
- foreach my $key (keys %{ $self->{escaped_strings_map} }) {
- $text =~ s/\Q$key\E/$self->{escaped_strings_map}->{$key}/g;
- }
+ my $self = shift;
+ my $text = shift;
+ my $iconv = $main::locale->{iconv};
- $text =~ s/\Q&\E/&/g;
+ $text = $main::locale->unquote_special_chars('HTML', $text);
+ $text = $main::locale->{iconv}->convert($text) if ($main::locale->{iconv});
return $text;
}