Error handling for debug output unicode problems