- my ($sort, $call, $line) = $data =~ /^(\w)([A-Z0-9\-]+)\|(.*)$/;
-
- # the above regexp must work
- return unless ($sort && $call && $line);
-
- # translate any crappy characters into hex characters
- if ($line =~ /[\x00-\x06\x08\x0a-\x1f\x7f-\xff]/o) {
- $line =~ s/([\x00-\x1f\x7f-\xff])/uc sprintf("%%%02x",ord($1))/eg;
-# dbg('chan', "<- $sort $call **CRAP**: $line");
-# return;
- }
+ my $error;
+ my ($sort, $call, $line) = DXChannel::decode_input($dxchan, $data);
+ return unless defined $sort;