Skip to content

Commit

Permalink
Do not use the Encode module to convert a code point to utf8
Browse files Browse the repository at this point in the history
It may not be availible in a stripped down build environment.
  • Loading branch information
mlschroe committed Aug 8, 2024
1 parent 66ac3ad commit 53e6d9d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Build/IntrospectGolang.pm
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ package Build::IntrospectGolang;
use strict;

use Build::ELF;
use Encode;

sub unpackgoaddr {
my ($d, $le, $sz) = @_;
Expand Down Expand Up @@ -142,8 +141,8 @@ my %parsequoted_special = (

sub parsequoted_special {
my ($s) = @_;
return encode('UTF-8', chr(oct($s))) if $s =~ /^[0-7]+/;
return encode('UTF-8', chr(hex(substr($s, 1))));
return pack('C0U', oct($s)) if $s =~ /^[0-7]+/;
return pack('C0U', hex(substr($s, 1)));
}

sub parsequoted {
Expand Down

0 comments on commit 53e6d9d

Please sign in to comment.