I had implemented app on some device which was dealing with sending receiving data from server. Data from server would usually come in this form:
"1;username;someInteger;"
Parsing was easy, and I was using strtok
as you can imagine to retrieve individual values from that string such as: 1
, username
, and someInteger
.
But now a situation may occur when the server will send me unicode string as username
.
I think good idea is to use the username encoded as a UTF-8 string (am I right?). What do you recommend - how should I parse it from above string? What symbol to use as a separator for example (e.g., instead of ";"), or which functions to use to extract the username
from above string?
as this is some embedded device I want to avoid installing some third party libraries there (which might not be even possible) so more "pure" ways would be more desirable.