Encoding of pagination link when using default permalinks.

Fixes #6220