when i exec command in powershell:
psql --command "\encoding" "host=XXX port=XXX user=XXX password=XXX dbname=postgres"
Output:
gbk
when i exec command in powershell:
$a=psql --command "\encoding" "host=XXX port=XXX user=XXX password=XXX dbname=postgres"
Write-Output $a
Now the output is different:
utf-8
this why?