From 3395290198aa899d3370af85ee6ca3fb7c995f00 Mon Sep 17 00:00:00 2001 From: Edward Oakley <47759261+fatchild@users.noreply.github.com> Date: Mon, 4 Sep 2023 14:39:00 +0100 Subject: [PATCH] Revert "ejo - removed encoding" --- lib/plugins/EPrints/ORCID/AdvanceUtils.pm | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/plugins/EPrints/ORCID/AdvanceUtils.pm b/lib/plugins/EPrints/ORCID/AdvanceUtils.pm index ab71293..ec166bc 100644 --- a/lib/plugins/EPrints/ORCID/AdvanceUtils.pm +++ b/lib/plugins/EPrints/ORCID/AdvanceUtils.pm @@ -196,16 +196,14 @@ sub write_orcid_record my $uri = $repo->config( "orcid_support_advance", "orcid_apiv2") . $user->value( "orcid" ) . $item; - my $content_as_json = to_json( $content ); - my $req = HTTP::Request->new( $method, $uri ); my @headers = ( 'Content-type' => 'application/vnd.orcid+json', 'Authorization' => 'Bearer ' . $user->value( "orcid_access_token" ), - 'Content-Lengh' => length( $content_as_json ), + 'Content-Lengh' => length( encode_utf8(to_json( $content ) ) ), ); $req->header( @headers ); - $req->content( $content_as_json ); + $req->content( encode_utf8(to_json( $content ) ) ); my $lwp = LWP::UserAgent->new; my $response = $lwp->request( $req );