I submit that we should use them in a way like some Markdown converters do, where the fragment is the header text. This is how you transform a header into a fragment:
1. Downcase the string
2. Remove anything that is not a letter, number, space or hyphen
3. Change any space to a hyphen.
4. If that is not unique, add "-1", "-2", "-3",... to make it unique
5. Encode non-ASCII characters so the entire string is URL-safe