my $requires_encoding = $_[0]->encodable_response;
my %fields = (
_writer => $writer,
- _encoding => $_[0]->_context->encoding,
+ _context => $_[0]->_context,
_requires_encoding => $requires_encoding,
);
sub write_encoded {
my ($self, $line) = @_;
- if((my $enc = $self->{_encoding}) && $self->{_requires_encoding}) {
+ if((my $enc = $self->{_context}->encoding) && $self->{_requires_encoding}) {
# Not going to worry about CHECK arg since Unicode always croaks I think - jnap
$line = $enc->encode($line);
}