Add binmode $output; right after opening the CSV file for writing. For example:
use strict; use warnings; my $string = '£'; open my $output, '>:encoding(utf8)', 'out.txt' or die $!; binmode $output; print $output $string; close $output;
Contents of out.txt:
£
Contents of out.txt without binmode $output;:
£
In reply to Re: Using encoding
by Kenosis
in thread Using encoding
by MorayJ
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |