Skip to content

Commit df65db5

Browse files
committed
Fixed base conversion on invalid data.
1 parent bdf19b3 commit df65db5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/utils.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def merge_ints(secrets)
3939
}
4040
}
4141

42-
return result.pack('C*').force_encoding("utf-8").gsub(/\u0000*$/, '')
42+
return result.pack('C*').force_encoding('UTF-8').encode('UTF-8', 'UTF-8', undef: :replace, invalid: :replace, replace: '').gsub(/\u0000*$/, '')
4343
end
4444

4545
# This evaluates a polynomial with reversed coefficients at a given

0 commit comments

Comments
 (0)