API Encoding UTF-8

Product: PowerShell Universal
Version: 1.5.14

Hi,

i created following API - Endpoint via WebUI ( GET /test )

#It’s all start with a single line of PowerShell code
@{
Name = “ä#dasü+d”
}

When i click “run” on the WebUI i get the right response.

[
{
“Name”: “ä#dasü+d”
}
]

But if i copy the Invoke-RestMethod … template from WebUI and run it in a local Powershell, i get something confusing.

Invoke-RestMethod http://example.com:5000/test

Name

ä#dasü+d

what am i doing wrong?

thanks for your help.
Patrick

On top of my head, try changing the file to UTF-8 with BOM

thx, for your help. But this endpoints.ps1 has already UTF-8 with BOM Encoding.

This is actually a problem with Windows PowerShell. It’s likely just an output thing in the console.

Here’s what it looks like in PS7

image

Thanks Adam.
When I ran the dashboard under 7.0.6 it works. :+1:

Hi,

I have the same problem. For me, the text entered on the dashboard is entered into an SQL database via a REST interface. But there I have the problem with characters like ÄÖÜß etc. that they are not stored in the database as ÄÖÜß.

My workaround is to convert the data in the dashboard to JSON. Then into a UTF8 byte stream. This is transmitted and returned in the REST interface from byte to JSON etc.