encode external uris