@## Steps to reproduce
Assuming you have a URI that returns json and contains a non-Latin char
My sample is a Confluence wiki page which I am requesting with REST
$splatParameters = @{
Uri = "https://powershell.atlassian.net/wiki/rest/api/content/13009245?expand=space,version,body.storage,ancestors&limit=25"
Method = "GET"
Headers = @{
"Accept-Charset" = "utf-8"
"Accept" = "application/json"
"Content-Type" = "application/json; charset=utf-8"
"Authorization" = "Basic abcd"
}
UseBasicParsing = $true
ErrorAction = 'SilentlyContinue'
};
Set-Content -Value (Invoke-WebRequest @splatParameters).Content -Path c:\temp\export.txt -Encoding UTF8 -force
Expected behavior
Invoke-WebRequest is able to write the file with full support of the unicode chars of the source.
In this example: Схема СКУД
Actual behavior
The REST call should return a json like this:
{"id":"13009245","type":"page","status":"current","title":"Схема СКУД","space":{....
instead, the content of c:\temp\export.txt (see example ebove) contains:
{"id":"13009245","type":"page","status":"current","title":"С�ема С�У�","space":{.....
Environment data
PS C:\Program Files\PowerShell\6.0.0-rc> $PSVersiontable
Name Value
---- -----
PSVersion 6.0.0-rc
PSEdition Core
GitCommitId v6.0.0-rc
OS Microsoft Windows 10.0.15063
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
@## Steps to reproduce
Assuming you have a URI that returns json and contains a non-Latin char
My sample is a Confluence wiki page which I am requesting with REST
Expected behavior
Invoke-WebRequestis able to write the file with full support of the unicode chars of the source.In this example:
Схема СКУДActual behavior
The REST call should return a json like this:
instead, the content of
c:\temp\export.txt(see example ebove) contains:Environment data