diff options
author | Yorhel <git@yorhel.nl> | 2008-11-11 19:16:49 +0100 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2008-11-11 19:16:49 +0100 |
commit | 947a4d87107d77f7e5e15d03e1cebbd294acc935 (patch) | |
tree | d755ff6808b9b475459323652ded800b5678da7d | |
parent | 5a71f64b9b030235275e8ce574221ec074b040cc (diff) |
Fixed the order of the gzip and utf8 I/O layers
:utf8 always has to be the one on top, as all data has to be
converted to UTF-8 encoded data -before- being gzipped
-rw-r--r-- | lib/YAWF/Response.pm | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/YAWF/Response.pm b/lib/YAWF/Response.pm index 012f490..5bcc126 100644 --- a/lib/YAWF/Response.pm +++ b/lib/YAWF/Response.pm @@ -27,7 +27,7 @@ sub resInit { content => '', }; - open $self->{_YAWF}{Res}{fd}, '>:utf8', \$self->{_YAWF}{Res}{content}; + open $self->{_YAWF}{Res}{fd}, '>', \$self->{_YAWF}{Res}{content}; # enable output compression by default if the PerlIO::gzip module is available # (we don't check for browser support or even content, but it's possible to @@ -37,7 +37,7 @@ sub resInit { binmode $self->{_YAWF}{Res}{fd}, ':gzip'; $self->resHeader('Content-Encoding' => 'gzip'); } - + binmode $self->{_YAWF}{Res}{fd}, ':utf8'; } @@ -95,7 +95,7 @@ sub resBuffer { # clear buffer close $i->{fd}; $i->{content} = ''; - open $i->{fd}, '>:utf8', \$i->{content}; + open $i->{fd}, '>', \$i->{content}; if(!defined $_[0] && $h || $_[0]) { binmode $i->{fd}, ':gzip'; @@ -103,6 +103,7 @@ sub resBuffer { } else { $self->resHeader('Content-Encoding', undef); } + binmode $i->{fd}, ':utf8'; } $h = $self->resHeader('Content-Encoding'); |