I receive Array with bytes:
var requestPtr = [3, 64, 0, 73, 0, 110, 0, 116, 0, 101, 0, 114, 0, 110, 0, 97, 0, 108, 0, 32, 0, 70, 0, 108, 0, 97, 0, 115, 0, 104, 0, 32, 0, 32, 0, 47, 0, 48, 0, 120, 0, 48, 0, 56, 0, 48, 0, 48, 0, 48, 0, 48, 0, 48, 0, 48, 0, 47, 0, 48, 0, 52, 0, 42, 0, 48, 0, 49, 0, 54, 0, 75, 0, 103, 0, 44, 0, 48, 0, 49, 0, 42, 0, 48, 0, 54, 0, 52, 0, 75, 0, 103, 0, 44, 0, 48, 0, 55, 0, 42, 0, 49, 0, 50, 0, 56, 0, 75, 0, 103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
Then remove first byte and convert array to string with this code:
requestPtr.remove(at: 0)
let nsdata = NSData(bytes: requestPtr, length: requestPtr.count)
var str = String(data: nsdata as Data, encoding: String.Encoding.utf8)!
If i do print in console it returns me string:
But i get weird encoding, when try to copy message.
And functions like str.hasPrefix("@Internal Flash") not working.
And var tmp1 = description.components(separatedBy: ["/"]) returns:
["\u{03}@\0I\0n\0t\0e\0r\0n\0a\0l\0 \0F\0l\0a\0s\0h\0 \0 \0", "\00\0x\00\08\00\00\00\00\00\00\0", "\00\04\0*\00\01\06\0K\0g\0,\00\01\0*\00\06\04\0K\0g\0,\00\07\0*\01\02\08\0K\0g\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"]
