I am using Rust to create a Postgres driver. When receiving raw Bytes from a websocket connection how can I properly decode it? I am making a TcpStream call to Postgres and get back a type BytesMut. I do String::from_utf8_lossy(&bytes[..]) to decode it. But that gives me stuff like this
id����createdAt@updatedAt@userName@��6fullName@��hdescription@���region@��6mainUrl���avatar@ ������Dv 12023-10-22 00:18:44.6872023-10-22 00:18:44.687jon
SELECT 1ZI 1 | John JamesI am a developer������������C
I believe those ? symbols represent pipes, because when my text does not have pipes it seems to parse fine without those symboles. But regardless what is the proper way to decode these bytes so that I get back carriage returns, spaces, etc? I tried utf16, but that did not work either (parsed into chinese). For example when using psql I get nicely formatted text like this screenshot.