powershell utf8 curl

powershell curl utf-8  乱码

$body = ‘{“users”:[“yang.sun”],”msg”:”‘ +  “中文字符串”  +'”}’

#使用此命令可以将,将要发送的内容转为utf-8编码方式【指定编码方式可转换为任何方式】。

[array]$params =[System.Text.Encoding]::UTF8.GetBytes($body)
curl -Uri “uri; -Method Post  -ContentType “application/json” -Body $params 

原文地址:https://www.cnblogs.com/bro-ma/p/13067718.html