_headerToLink() produces headers like this:
<h1><a name="тестовая_страница" id="тестовая_страница">тестовая страница</a></h1>
The 'id' attribute is invalid: non ascii symbols no allowed here.
In the release 2006-03-09b id was correct, e. g.:
<h1><a name="testovaja_stranica" id="testovaja_stranica">тестовая страница</a></h1>
Patch in attached file. May be it wrong but works for me.
And why _headerToLink() copy-pasted in 2 files?