extensions/extension-editing/src/extensionLinter.ts/parseUri
function parseUri(src: string, base?: string, retry: boolean = true): Uri | null {
	try {
		let url = new URL(src, base);
		return Uri.parse(url.toString());
	} catch (err) {
		if (retry) {
			return parseUri(encodeURI(src), base, false);
		} else {
			return null;
		}
	}
}