Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/Pinto/Chrome/Net.pm
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ use Moose;
use MooseX::StrictConstructor;
use MooseX::MarkAsMethods ( autoclean => 1 );

use Encode qw( encode_utf8 );

use Pinto::Types qw(Io);
use Pinto::Util qw(itis);
use Pinto::Constants qw(:protocol);
Expand Down Expand Up @@ -58,7 +60,7 @@ sub diag {
# messages that go to stderr and those that should go to stdout
$msg =~ s/^/$PINTO_PROTOCOL_DIAG_PREFIX/gmx;

print { $self->stderr } $msg or croak $!;
print { $self->stderr } encode_utf8( $msg ) or croak $!;
}

#-----------------------------------------------------------------------------
Expand All @@ -70,7 +72,7 @@ sub show_progress {

$self->stderr->autoflush; # Make sure pipes are hot

print { $self->stderr } $PINTO_PROTOCOL_PROGRESS_MESSAGE . "\n" or croak $!;
print { $self->stderr } encode_utf8( $PINTO_PROTOCOL_PROGRESS_MESSAGE . "\n" ) or croak $!;
}

#-----------------------------------------------------------------------------
Expand Down
9 changes: 5 additions & 4 deletions lib/Pinto/Chrome/Term.pm
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use MooseX::MarkAsMethods ( autoclean => 1 );

use Term::ANSIColor;
use File::Which qw(which);
use Encode qw( encode_utf8 );

use Pinto::Editor;
use Pinto::Types qw(Io ANSIColorPalette);
Expand Down Expand Up @@ -94,7 +95,7 @@ sub show {

$msg .= "\n" unless $opts->{no_newline};

print { $self->stdout } $msg or croak $!;
print { $self->stdout } encode_utf8( $msg ) or croak $!;

return $self;
}
Expand All @@ -120,7 +121,7 @@ sub diag {
$msg = $self->colorize( $msg, $opts->{color} );
$msg .= "\n" unless $opts->{no_newline};

print { $self->stderr } $msg or croak $!;
print { $self->stderr } encode_utf8( $msg ) or croak $!;
}

#-----------------------------------------------------------------------------
Expand All @@ -132,7 +133,7 @@ sub show_progress {

$self->stderr->autoflush; # Make sure pipes are hot

print { $self->stderr } '.' or croak $!;
print { $self->stderr } encode_utf8( '.' ) or croak $!;

$self->has_made_progress(1);
}
Expand All @@ -145,7 +146,7 @@ sub progress_done {
return unless $self->has_made_progress;
return unless $self->should_render_progress;

print { $self->stderr } "\n" or croak $!;
print { $self->stderr } encode_utf8( "\n" ) or croak $!;
}

#-----------------------------------------------------------------------------
Expand Down