0

I want to connect to Twitch server. But Godot adds binary characters in front of my data as you can see in the pictures. This happens everytime no matter the data type. Why is this happenning and how can I prevent this happening?
python socket server output image

code

Hasta Dhana
  • 4,631
  • 7
  • 17
  • 26

2 Answers2

0

Perhaps an issue with a BOM from UTF8-encoding. A BOM (Byte Order Mark) may be prepended to UTF8 strings in some cases but is not necessary and usually not recommended. Check: What's the difference between UTF-8 and UTF-8 without BOM?

Try removing the first two bytes in your stream data and see if that helps.

Daniklad
  • 759
  • 6
  • 10
0

Some functions like var2bytes() prefix its output with some type data so it can build it back to an engine type like with bytes2var().

You will have to be aware of these when transmitting data.

hola
  • 2,180
  • 9
  • 21