After applying service pack 14503, scripts written in Powershell do not properly edit the subject and description fields. This means that Polish characters are not displayed correctly. For example: ąąąććć
param (
[string]$json = $(throw "-json is required.")
)
$jsonContent = Get-Content $json -Encoding UTF8
$jsonContent | Set-Content -Encoding UTF8 Test.txt
$jsonContent = ConvertFrom-Json -InputObject $jsonContent
$requestid = $jsonContent.request.id
$apikey = xxx
$urlSDP = xxx
$header = @{ }
$header.add("authtoken", $apikey)
[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true};
function updateRequest() {
param(
$id,
$apikey,
$sdpurl,
$json
)
$url = $sdpurl + "/api/v3/requests/" + $id
$header = @{ }
$header.add("authtoken", $apikey)
$body = @{ }
$body.add("input_data", $json)
$result = invoke-restmethod -method PUT -uri $url -headers $header -body $body -contenttype application/x-www-form-urlencoded
return $result
}
$inputData = @{
request = @{
subject = "ąąąććć"
}
} | convertto-json -depth 10
$result = updateRequest -id $requestid -sdpurl $urlSDP -apikey $apikey -json $inputData