我想保存网站的输出并且编码丢失。
以下是脚本test.ps1
,需要curl.exe
(cinst curl)
$content = 'kuca'
$url = "https://www.slovomajstor.com/wmst/http?app=transliterator&request=transliterate&reqLang=sr-bald&targetLang=sr-latn"
$refer = "Referer: https://www.slovomajstor.com/index.latn.html"
$contentType = "Content-Type: application/x-www-form-urlencoded charset=UTF-8"
curl.exe $url -H $contentType -H $refer --data "$content"
这是ConEmu中可见的输出(其字体是Courier new,编码东欧以防相关)。
<span kon:baldWord='kuca' ... kon:options='kuća,kuca,kuča'>kuća</span>
如果我现在运行./test.ps1 | Out-File out.html -Encodiong whatever
它就像垃圾一样。浏览器显示ku─ça
而不是kuća
。
怎么办?