I have a byte array with a series of characters. In one case I have
[28] = 0x6e
[29] = 0x61
[30] = 0x6d
[31] = 0x65
[32] = 0x00
[33] = 0x00
[34] = 0x00
[35] = 0x4f
[36] = 0x08
[37] = 0x00
[38] = 0x07
[39] = 0x00
[40] = 0x00
[41] = 0x04
[42] = 0x13
[43] = 0xff
[44] = 0xff
[45] = 0x00
[46] = 0x00
28 to 31 has the characters "name" with that section ending on element 32. Then I have another byte array:
[47] = 0x01
[48] = 0x03
[49] = 0x00
[50] = 0x00
[51] = 0x73
[52] = 0x65
[53] = 0xc3
[54] = 0xb1
[55] = 0x6f
[56] = 0x72
[57] = 0x00
[58] = 0x00
[59] = 0x00
[60] = 0x4f
[61] = 0x08
[62] = 0x00
[63] = 0x08
[64] = 0x00
[65] = 0x00
[66] = 0x04
[67] = 0x13
[68] = 0xff
[69] = 0xff
[70] = 0x00
[71] = 0x00
where I believe I have the string señor.
With the first array it's easy to find the name as the first 4 bytes with 00 as a terminator but how do I decipher whats on the second byte array?
Both arrays are vector<char>s.
name, you probably use UTF8. In any case, a UTF8 string in C++ is a std::string