Header and link with spaces:
== Nbsp test == [[#Nbsp test]]
id="Nbsp_test" href="#Nbsp_test"
Header and link with non-breaking spaces:
== Nbsp test == [[#Nbsp test]]
id="Nbsp.C2.A0test" href="#Nbsp_test"
We have non-breaking space → space replacement for a long time since T17248. We need to make exactly the same replacement for headers.