Fix broken set/sys_qra command
[spider.git] / perl / Spot.pm
index 0df6891799dd8a3006da9c2a1c1880fcc16a86b6..a87b9c85b1b6c8581f2ad4675675b2654ea584bc 100644 (file)
@@ -21,11 +21,7 @@ use QSL;
 
 use strict;
 
-use vars qw($VERSION $BRANCH);
-
-($VERSION, $BRANCH) = dxver(q$Revision$);
-
-use vars qw($fp $statp $maxspots $defaultspots $maxdays $dirprefix $duplth $dupage $filterdef $totalspots $hfspots $vhfspots $maxcalllth);
+use vars qw($fp $statp $maxspots $defaultspots $maxdays $dirprefix $duplth $dupage $filterdef $totalspots $hfspots $vhfspots $maxcalllth $can_encode);
 
 $fp = undef;
 $statp = undef;
@@ -406,6 +402,7 @@ sub dup
                }
        }
        my $otext = $text;
+       $text = Encode::encode("iso-8859-1", $text) if $main::can_encode && Encode::is_utf8($text, 1);
        $text =~ s/^\+\w+\s*//;                 # remove leading LoTW callsign
        $text = pack("C*", map {$_ & 127} unpack("C*", $text));
        $text =~ s/\s{2,}[\dA-Z]?[A-Z]\d?$// if length $text > 24;