mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-10-15 11:44:51 +08:00
strings record encoding used to create them.
in order to recreate the valid bytes for use in decryption it is necessary to know which encoding was used to read a string token. this is because utf16-be encoding has a byte-order marker which should be included in the resulting bytes.
This commit is contained in:
@@ -43,7 +43,7 @@
|
||||
{
|
||||
if (ownerToken is StringToken ownerString)
|
||||
{
|
||||
ownerBytes = OtherEncodings.StringAsLatin1Bytes(ownerString.Data);
|
||||
ownerBytes = ownerString.GetBytes();
|
||||
}
|
||||
else if (ownerToken is HexToken ownerHex)
|
||||
{
|
||||
@@ -56,7 +56,7 @@
|
||||
{
|
||||
if (userToken is StringToken userString)
|
||||
{
|
||||
userBytes = OtherEncodings.StringAsLatin1Bytes(userString.Data);
|
||||
userBytes = userString.GetBytes();
|
||||
}
|
||||
else if (userToken is HexToken userHex)
|
||||
{
|
||||
|
Reference in New Issue
Block a user