String to Stringstream conversion failure

Asked

Viewed 42 times

1

I’m having a problem converting the contents of a String to Stringstream. The contents of the string are:

H4sIAAAAAAAEAKU5aZeiyLJ/hdP3fbj31HSxiUI17TmsirIoi9uXexAQURYFFPXXv0iwqqt75s3cua/7FBkZGREZGVsGwue7aFYWAXaNysovvn+hX0niC3bL0rz6/mVf16c3HG+a5vVUlLWf7pIq8NPXJN+9bksceL8MeVON/hY9TBCLFn7/AiPNkCxBE/SAYwmuTxAExfQYhiDIDuz1BwDRLNWjBsyXn7UEUWE05ANPHdIMj6ORD0x1+E4PKJjxuV9bp6GtuJZtWpisYIJtCBvFFEaKwePdKigVzvx4SPH4E+KzIhwyIBaNfBWVSTQkebwD+BwEd9qBBLRJuFeyZEgRJPuVoL+SrEtwbz36jaBg+kYQPN4RAJ3jJ0pe/znpk4avTyAbdm1HOK0cVTWaPyE+MC65OoLT91gGcT7nwKdlp44RATCHzasO0UJ8IC+GyGYwwKqQbbtFBPC7BI7UnvYJIeuoSe6nQ6K1Twe3Niujash1RkMgf4JYQgcFwneQB6ehEBtKRQlR4dcRBkJ5/B2NjgN7RFkCJ5LM2WT4czTweIvkb2aRRUPwmoW5im1opqA52Ic3HWyk2AjjvAo83tHyN9UHM7Ysmj5G+BbBR3kYlUq74U2PyyFaRJEhCrYpiArQISyfl8VwAKdDI3+TTulwZlvCzIF1NOFvop+UsCZbkoCQz2nrlp+dArTo6QimayHKFgXx6sx4HIWtpMyGJElwzABxoBkfzHzkMoJhQUQL87d2EG3B0XQQ0iF3RR5ByJM0TREUyoMWweOfzqgpwz5NMxzNDliSBIMCgpdsd0jDXjAAcUsXtkHVWpvs94gexQ4Ikulz5M8ucLyNAJk0E2aKDg6QFN3TLUf5yfLt7l2QtrZUHBeTLUwHXwiy9dnAxGf7OibmCLqAOeLvjPyD9RczU32OoH4ys64ZimYL/5ed6R7bJznuv7IzSdJ9us8gI362c3dSyAJN+cjRjwmyf48cUH1mMEACOvvjnbX9S70y9D8NfPydJoxqLNfqK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yhPZVGjD5W/fnPMdzNYab9faiHZvoKRLN1jBgOa+vL7r2nALpxSeFd1Zv82VeXfM/3fBMEmVPsBrFvhgz3a8e+8zfF4x8OHezsKtnXx+w+KFPPjg+KThs+R6sNflObxDs2HSQzN9l+8Jj2J+MCpfRDVfuFqQf5mFHVyLYbCBf0I8UA/OhXYpSqw0MdM9WuEflrsKNrX9m5P/GlmgJ6foof/CxMhQqWUHgAA

The code I’m using for the conversion is this:

var
  lStr: TStringStream;
  sInfo: WideString;
begin
  lStr := TStringStream.Create(sInfo);
end;

However, after this "create", the variable lStr zeroed.

I believe it is because it contains escape characters and I’m not sure how to handle it in the string.

  • after the create, simulating here, I tested the lStr.DataString and it is correct, as it is testing the content of lStr?

  • Using debug, after create I place the mouse over the variable and only "()" appears. Should I use another way?

1 answer

3


When using the TStringStream Delphi converts the string into bytes, this way we cannot debug directly with the mouse cursor.

However, the string still exists within the stream variable, but what is used is the bytes (binary formatted string).

To compare you can use the property DataString.

if lStr.DataString = sInfo then
  ...
  • All right... thank you so much for your help!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.