» is interpreted as "as conclusion"

Issue #71 resolved
mezzodrinker
created an issue

The code fragment

say "", "«blah»"

should be displayed as "«blah»" with a > in the bottom right corner. Instead, MobTalker2 displays "«blah" with a ■ in the bottom right corner, as if as conclusion had been used.

Comments (9)

  1. mezzodrinker reporter

    This may be caused by the implementation of MessageShowText.toBytes(ByteBuf). » in UTF-8 representation equals 0xC2 0xBB in hexadecimal or 11000010 10111011 in binary version. Because toBytes(ByteBuf) appends a 1 if as conculusion is used and 0 if not, the reverse operation may misinterpret the binary string as an invalid UTF-8 character and a 1 bit for as conclusion. That may result in the trailing » character being swallowed up and ■ being displayed in the bottom right corner.

  2. mezzodrinker reporter

    Actually, the issue may be caused by MobTalkerMessage.writeString(ByteBuffer, String) when using characters that are not part of ASCII. writeString measures the amount of characters that are to be written to the ByteBuffer, not the amount of bytes. Because both « and » are worth two bytes but are one character, the message's length is two bytes short. Thus, » is ignored and the comparison of the remaining bytes (11000010 10111011) with 0 yields false, so apparently, the ByteBuffer returns true on the readBoolean() call. That explains the missing » and ■.

  3. Log in to comment