Improve robustness of mmd_toc for non-ASCII characters.