use Encode qw/from_to/; from_to($output, "cp850", "UTF-8");