use Device::SerialPort; my $PortObj = Device::SerialPort( ... ); binmode $PortObj->{FD}, ':utf8'; ...