Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Proof of the bug:
I'm sorry I have no theory as to what could be the cause.
The truncation code was not considering entities. Now it is! :-)
The fix should be applied in the next chat deployment.