Friday, 27 October 2023
  1 Replies
  354 Visits
  Subscribe
Hello Sergio,
I noticed that if the ContentText contains extended characters, they are lost in transmission to the browser.
The problem is due to the string to stream conversion that occurs in the "DoHTTP2Response" function in the "sgcWebSocket_Classes_HTTP2" unit.
While waiting for your solution, I tried to modify the function in this way and it works for me.

sgcWebSocket_Classes_HTTP2 row 208;

original code

if aResponse.ContentText <> '' then
oStream := TStringStream.Create(aResponse.ContentText)

modified code

if aResponse.ContentText <> '' then begin
var B :=ToBytes(aResponse.ContentText,CharsetToEncoding(aResponse.CharSet));
oStream := TBytesStream.Create(TBytes(B));
B := [];
end