I've found something new:
I was able to copypaste the string from xchat to a pastebin with utf-8 support: http://nopaste.biz/19546 (I don't know how long will be available there)
Here is what I tried:
If I copypaste the string from the nopaste to the channel I can see it correctly (both in the editbox and in the channel), instead, the other users in the channel will see it as in the first screenshot.
I also tried //echo -a $line($active, $line($active,0)) and the line I copypasted is still showed correctly, instead the line writed by my bot is still wrong.

The problem seems related to something between the reception of the PRIVMSG and the visualization of the line in the channel. It's like after the reception the string get corrupted in the middle and there is no way to see the second half, and the first half has problems depending on the width of the window.

If this is not enough and you can't still reproduce this issue I could reach you in your server (if you prefer my server/channel are written in my profile) and show you the problem.

Taggnostr