TBuffer.Tostring calls ConvertToHexString
Issue #328
resolved
Trying to use the TripleDES class and ran into a problem where TBuffer.ToString is giving me a hex string - looked at the code and see it calls ConvertToHexString
I worked around it by doing this :
mystring := TEncoding.Unicode.GetString(output.AsBytes);
Comments (3)
-
repo owner -
reporter Ok thanks, makes sense.
-
reporter - changed status to resolved
as designed
- Log in to comment
While the existence of ToHexString as well makes it a bit superflous I would argue this is the only proper implementation as we are talking about some byte buffer here which cannot be converted to a meaningful or even correct string in all cases.
When you know that it’s a string using TEncoding.GetString as you did is the correct way.