You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Due to using syswrite() strings must be passed as UTF-8 encoded bytes:
An example where this is a problem with a workaround:
#!/usr/bin/env perluse utf8;
use Encode;
use PDL;
use PDL::Graphics::Gnuplot;
use PDL::Constants qw(PI);
subplot_sin {
my ($w, $coeff) = @_;
my$xrange = [ -2*PI, 2*PI ];
my$x = zeroes(1e3)->xlinvals(@$xrange); my$y = sin($coeff * 2 * PI * $x );
my$title = "y = sin( $coeff * 2π * x )";
# to get around sending text through syswrite()my$title_octets = encode('UTF-8', $title);
$w->plot(with=>'lines', $x, $y, {
xrange=>$xrange,
title=>$title_octets, # can not pass $title as-is
});
}
The text was updated successfully, but these errors were encountered:
Due to using
syswrite()
strings must be passed as UTF-8 encoded bytes:An example where this is a problem with a workaround:
The text was updated successfully, but these errors were encountered: