summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/TUWF/Response.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/TUWF/Response.pm b/lib/TUWF/Response.pm
index 628eb4d..d2b7150 100644
--- a/lib/TUWF/Response.pm
+++ b/lib/TUWF/Response.pm
@@ -5,6 +5,7 @@ package TUWF::Response;
use strict;
use warnings;
use Exporter 'import';
+use Encode 'encode_utf8';
use POSIX 'strftime';
use Carp 'croak';
@@ -244,9 +245,9 @@ sub resFinish {
} else {
printf "Status: %d\r\n", $i->{status};
}
- printf "%s: %s\r\n", $i->{headers}[$_*2], $i->{headers}[$_*2+1]
+ printf "%s: %s\r\n", encode_utf8($i->{headers}[$_*2]), encode_utf8($i->{headers}[$_*2+1])
for (0..$#{$i->{headers}}/2);
- printf "Set-Cookie: %s\r\n", $i->{cookies}{$_} for (keys %{$i->{cookies}});
+ printf "Set-Cookie: %s\r\n", encode_utf8 $i->{cookies}{$_} for (keys %{$i->{cookies}});
print "\r\n";
print $i->{content} if $self->reqMethod() ne 'HEAD';