T
T
TechNOIR2018-02-28 09:35:01
PowerShell
TechNOIR, 2018-02-28 09:35:01

Powershell. How to solve the problem with question marks instead of Russian letters?

Good afternoon. I get the result via JSON API. But Russian letters are displayed as question marks..
Any ideas, comrades? Thanks in advance
What I'm running:

$url2 = "http://********/rooms?limit=3&access_token=******"
$rres = Invoke-WebRequest -Method GET -Uri $url2 -ContentType "application/json;charset=utf-8" | ConvertFrom-Json
$Lmres = $rres.chunk
Write-Host $Lmres[0].Content

I get:
@{body=???? ??????) ; msgtype=m.text}
@{body=??????????????; msgtype=m.text}
@{body=??????????; msgtype=m.text}

I changed the encoding of the request to json to win-1251, nothing has changed.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
azarij, 2018-02-28
@azarij

try using write-output instead of write-host.

K
Kilobox, 2018-03-16
@Kilobox

I had a similar problem when importing CSV, applied this crutch
$users = get-content D:\rest\import_list.csv
$cusers = convertfrom-csv $users
Try the same principle.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question