I am writing synchronization Service Desk Plus + Redmine. Problem with encoding (from SDP I get JSON file, encode in utf-8, take away variables, transfer xml to redmine with necessary parameters. A task in Redmine is created, problem with encoding: "????????" instead of Cyrillic. Text script:
param ( [string]$json = "none" ) $jsondata = get-content $json -encoding UTF8 $obj = ConvertFrom-Json $jsondata $ticket = $obj.request.WORKORDERID $apikey = "" $baseurl = "http://localhost" $header = @{"Content-Type"="application/xml"} $url = $baseurl + "/issues.xml?key=" + $apikey $xml = @" <issue> <project_id>55</project_id> <subject>test</subject> <description>тест</description> <custom_fields type="array"> <custom_field id="2"> <value>test</value> </custom_field> </custom_fields> </issue> "@ Invoke-WebRequest -Uri $url -Method Post -Body $xml -headers $header PS in Redmine code table base "UTF8".