Good luck, though, knowing when a user's nick (or a channel) is UTF-8 encoded in the instance of the server, and when it's not.
$rawbytes was added to overcome that limitation, it returns non-decoded and unaltered received text. prior to its addition,
/debug -i could also have been used, though less comfortably, to handle the data as it was originally received