Using powershell.exe (Windows PowerShell 5.1) as the shell, redirected output is written as UTF-16 LE:
@("alpha", "beta", "gamma") *> $env:TEMP\dc-utf16-test.txt
Reading that file with read_file returns text containing embedded NUL characters.
This causes tool-result persistence to fail with PostgreSQL error 22P05: \u0000 cannot be converted to text.
Reproduction
- Set
defaultShell to powershell.exe.
- Run:
@("alpha", "beta", "gamma") *> $env:TEMP\dc-utf16-test.txt
- Call
read_file on dc-utf16-test.txt.
- The returned text contains NUL characters between letters.
Expected
read_file should detect the UTF-16 BOM and decode the file as UTF-16 LE.
Additional result
The same command does not reproduce with pwsh.exe (PowerShell 7), which writes UTF-8 output by default.
Tested with Desktop Commander 0.2.44 on Windows 11.
Using
powershell.exe(Windows PowerShell 5.1) as the shell, redirected output is written as UTF-16 LE:Reading that file with
read_filereturns text containing embedded NUL characters.This causes tool-result persistence to fail with PostgreSQL error
22P05: \u0000 cannot be converted to text.Reproduction
defaultShelltopowershell.exe.read_fileondc-utf16-test.txt.Expected
read_fileshould detect the UTF-16 BOM and decode the file as UTF-16 LE.Additional result
The same command does not reproduce with
pwsh.exe(PowerShell 7), which writes UTF-8 output by default.Tested with Desktop Commander
0.2.44on Windows 11.