Encode and sanitize menu labels and event names