TcpReadUTF connection, data$
This command reads 16 bit unicode characters, in the UTF-8 string format, from a specified TCP socket connection. Any data read is returned in the data$ parameter. This command should be used to receive a string sent by a TcpWriteUTF.
Strings are encoded in a slightly modified form of UTF-8. This form is identical to standard UTF-8, except:
After a TcpReadUTF it is important to check if the read succeeded. All internet connections are subject to interruption at any time so check the TcpGetError$(n) after each TCP command you execute. TcpGetError$(n) will return an empty string if the read succeeded.
You can use the TcpGetSize(n) function to check how many bytes are available to be read.