Constrain invalid slugs in the routes.

This will prevent blowing up when given invalid UTF-8 etc.