Skip to content
This repository was archived by the owner on Jul 12, 2023. It is now read-only.

Commit 0ebdf23

Browse files
committed
encode utf8
1 parent 8d9732c commit 0ebdf23

File tree

2 files changed

+3
-21
lines changed

2 files changed

+3
-21
lines changed

lib/Net/Xero.pm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ use Crypt::OpenSSL::RSA;
1414
use URI::Escape;
1515
use Data::Dumper;
1616
use IO::All;
17+
use Encode qw(decode encode);
1718

1819
$Net::OAuth::PROTOCOL_VERSION = Net::OAuth::PROTOCOL_VERSION_1_0A;
1920

@@ -321,14 +322,13 @@ sub _talk {
321322
my $request = Net::OAuth->request("protected resource")->new(%opts);
322323
my $private_key = Crypt::OpenSSL::RSA->new_private_key($self->cert);
323324
$request->sign($private_key);
324-
325325
my $req = HTTP::Request->new($method, $request->to_url);
326326

327327
#$req->header(Authorization => $request->to_authorization_header);
328328
if ($hash) {
329329
#$req->content('xml=' . uri_escape($self->_template($hash)));
330330
#$req->header('Content-Type' => 'application/x-www-form-urlencoded; charset=utf-8');
331-
$req->content($self->_template($hash));
331+
$req->content(encode('UTF-8', $self->_template($hash)));
332332
$req->header('Content-Type' => 'form-data');
333333
}
334334

@@ -342,7 +342,7 @@ sub _talk {
342342
}
343343
else {
344344
#warn "Something went wrong: " . $res->status_line;
345-
$self->error($res->status_line . " " . $res->content);
345+
$self->error($res->status_line . " " . $res->content);
346346
}
347347

348348
return;

t/pod-coverage.t

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)