JTV 2 Receiving Messages

@Sunspots afaik this behaviour is the same for all major languages.

Just want to add that I had a little bit of trouble with supplementary characters and the emote metadata.

The line/string:

Kappa 𠜎 Kappa

will have this emote field:

emotes=25:0-4,8-12;

This is correct in the way it is represented, but if you iterate over the string; supplementary characters like 𠜎 will (depending on the encoding) be contained in 2 16-bit characters. Thus the position of the next emotes will be off by one for each previous supplementary character. This can be something others also need to take into account.

The general iterating pattern for strings with supplementary characters in java is something like:

for (int i = 0; i < str.length();) {
    //do something with character or codepoint
    i += Character.charCount(str.codePointAt(i));
}