`safe_unicode` is supposed to be used for exceptions. I think you want `cast_unicode`.