I stumbled across this recently...
The name of the routine implies it converts special characters to hexadecimal character constants. It does not.
It uses decimal (%d in its Format argument instead of %x). And converts to #ddd notation instead of #$xx.
Just looking for confirmation before filing a bug report.