A proxy hostname can contain international characters in its displayed form. A client or resolver expecting the IDNA ASCII form needs that hostname converted, rather than an arbitrary percent-escaped copy of the whole URL.

In PowerShell, .NET exposes the conversion directly:

$mapping = New-Object System.Globalization.IdnMapping
$asciiHost = $mapping.GetAscii($unicodeProxyHost)
$endpoint = New-Object System.UriBuilder
$endpoint.Scheme = 'http'
$endpoint.Host = $asciiHost
$endpoint.Port = 8080

$proxy = New-Object System.Net.WebProxy($endpoint.Uri)

unicodeProxyHost is only the domain name. The port and scheme stay separate. Use the resulting proxy on the HTTP client making the request.

For an already parsed Uri, IdnHost exposes its IDNA-compatible hostname representation. Review the original endpoint rather than repeatedly encoding an already encoded label.

Distinguish the proxy’s hostname from the destination’s hostname in a resolution error. Converting one does not correct a misspelling or missing DNS record on the other. Keep the intended hostname for certificate identity too; replacing it with an arbitrary IP address changes another part of the connection.

Tënë sô zo