As mentioned above, you should
not be calling $utfencode on data from 7.x as it is
already Unicode.
$asc($chr(%x)) should be sufficient in 7.x
Again, this is not a bug, it is an intentional benefit of mIRC's Unicode support
To deal with old scripts, use this alias:
alias myutfencode { return $iif($version < 7, $utfencode($1-), $1-) }
Though I wonder if maybe mIRC could just no-op the $utfencode/$utfdecode aliases from 7.x on to avoid confusion.