use POSIX qw(strftime);
use Time::HiRes qw(clock_gettime CLOCK_MONOTONIC);
use URI::Escape qw(uri_escape_utf8);
-use Encode qw(find_encoding);
-my $enc_utf8 = find_encoding('UTF-8');
use constant {
r501 => '501 command syntax error',
r221 => '221 Header follows',
found:
my $o = 'HEAD:' . mid2path($mid);
my $bytes;
- my $s = eval { Email::Simple->new($ng->gcf->cat_file($o, \$bytes)) };
+ my $s = eval { Email::Simple->new($ng->git->cat_file($o, \$bytes)) };
return $err unless $s;
my $lines;
if ($set_headers) {
sub res ($$) {
my ($self, $line) = @_;
- $line = $enc_utf8->encode($line);
+ utf8::encode($line);
do_write($self, $line . "\r\n");
}
sub do_more ($$) {
my ($self, $data) = @_;
- $data = $enc_utf8->encode($data);
+ utf8::encode($data);
if (MSG_MORE && !$self->{write_buf_size}) {
my $n = send($self->{sock}, $data, MSG_MORE);
if (defined $n) {