Encode only the first part of the URI so the serialised parts can be auto-encoded.