5

Is it possible to do a soql with sfdx and have the output in utf8 format? I trying extract out data in Thai language but I'm getting unreadable characters. This works fine in data loader. The code sample is below.

sfdx force:data:soql:query -u <username> -q "select Id, Name from Account" --resultformat json > "out.txt"

Also tried below command:

Get-Content "out.txt" | Set-Content -Encoding utf8 "out_utf8.txt"

Thank you.

1 Answer 1

4

I figured it out. This has nothing to do with sfdx. It's the setting in powershell.

This works:

[Console]::OutputEncoding = New-Object -typename System.Text.UTF8Encoding

sfdx force:data:soql:query -u someusername -q "select Id, Name from Account" --json | out-file -encoding utf8 "test.txt"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .