SwiftSocket
SwiftSocket copied to clipboard
how can i read data in string formate
Hi daer! How can i read data in string formate.... tell me any work around bacouse my server is sending back data in string formate... its urgent please please give me responce as soon as possible
Any sort of information you receive is byte formatted. Since a UTF-8 character is 4 bytes in length (32bits), you can turn those bytes into UTF-8 characters. You can do it when creating a string object:
String(bytes: bytes, encoding: .utf8)