harelba / q

q - Run SQL directly on delimited files and multi-file sqlite databases
http://harelba.github.io/q/
GNU General Public License v3.0
10.21k stars 423 forks source link

Using q inside Windows PowerShell causes encoding issues #311

Open nelsoncarr opened 1 year ago

nelsoncarr commented 1 year ago

Hello!

I'm an avid user of q but have recently run into the following issue:

When I'm using q on Windows 11 within PowerShell 7.2.9, special characters like Ä, ä, Ö, ö, Ü, ü are not probably encoded in the output file.

Sample command in Windows Powershell:

q -W all "SELECT column1, column2, column3 from input.csv" --encoding=UTF-8 --query-encoding=UTF-8 --output-encoding=UTF-8 -d"," -H -O > output.csv

ä for example is turned into "├ñ".

When I'm executing the same command in Window's normal cmd, I see no encoding issues in the output file. I would however prefer to run it inside PowerShell as I can combine it with other powerful commands.

Do you know how to fix this?

Many thanks in advance.