Ok, different bug. I wiresharked the output and it's plain UTF-8. Problem seems to be that mIRC does the double encoding on debug output for some strange reason.