Search code examples
jsonpowershellhebrewconvertfrom-json

Powershell ConvertFrom-Json Hebrew --> Question marks


I'm trying to convert Powershell Variable from Json and I get question marks instead of Hebrew.

As far as i know there is no encoding parameter for ConvertFrom-Json, any ideas how can i pass the hebrew?

take a look at this word: מחילמ

PS D:\wa2> $BotUpdates


StatusCode        : 200
StatusDescription : OK
Content           : {"succes":true,"response":[{"key":{"remoteJid":"","fromMe":false,"id":"","participant":""},"message":{"conversation":"***מחילמ***"},...
RawContent        : HTTP/1.1 200 OK
                    Connection: keep-alive
                    Keep-Alive: timeout=5
                    Content-Length: 308
                    Content-Type: application/json; charset=utf-8
                    Date: Thu, 24 Dec 2020 13:35:35 GMT
                    ETag: W/"134-v3U3d/6PCvlXMASgH7...
Forms             : {}
Headers           : {[Connection, keep-alive], [Keep-Alive, timeout=5], [Content-Length, 308], [Content-Type, application/json; charset=utf-8]...}
Images            : {}
InputFields       : {}
Links             : {}
ParsedHtml        : mshtml.HTMLDocumentClass
RawContentLength  : 308

And after converting from Json

PS D:\wa2> ($BotUpdates | ConvertFrom-Json).response

key                                                                                                                      message                    messageTimestamp participant                
---                                                                                                                      -------                    ---------------- -----------                
@{remoteJid=18XXXXXX; fromMe=False; id=3AXXXXXX67A1; participant=9} @{conversation=??????????} 1608816932       



PS D:\wa2>

take a look at @{conversation=??????????}

Any ideas?


Solution

  • Well, I would like to update that I solved it by converting

    ($BotUpdates.content | ConvertFrom-Json).response
    

    Instead of

    ($BotUpdates | ConvertFrom-Json).response