使用包含重音符号的脚本调用 psql 时,如何在 nsis 中使用 nsExec::Exec?

How to use nsExec::Exec in nsis, when calling psql with a script containing accents?

我尝试用 psql 执行这个脚本

insert into users (id, name) values ('n1', 'marie');
insert into users (id, name) values ('n2', 'kévin');

在 NSIS 3.03 中,使用

nsExec::Exec '"psql.exe" -U postgres -f "script.sql"'

只插入值'n1',所以没有重音符号。

使用 ExecWait 而不是 nsExec::Exec 插入所有行,但我不想出现黑色 DOS 框; ExecDos 导致与 nsExec::Exec.

相同的问题

我该怎么做才能使 nsExec::Exec 在包含重音的脚本中正常工作?

将我的脚本编码为 UTF-8 而不是 Windows-1252 解决了问题