A friend/colleague asked me this question. In the create field UI of SharePoint there is no Internal field input. How to assign internal field name?
So here is the trick.
1. First create the field as you want for your internal name e.g. “Gender”
2. Once field is created edit the field and change the name back to what you want user to see e.g “What is your Gender?”.
In summary never create the field name as “What is your Gender?” This will create a nasty internal name with escape characters.
Some additional behind the scene workings of the create field UI. When you first time create a new field SharePoint assigns the InternalName and DisplayName as whatever you types. In this case “Gender”. Later you go and edit this field SharePoint only edits the DisplayName and InternalName remains the same.