make find-encoding return nil when the argument is nil