Fixed routing with non ASCII characters.

fixes #2946

This should work now.
(also fixed some indentation issues from a previous commit)