Description
Version: es.exe 1.1.1.39 (x64), Everything 1.4.1.1030, Windows 11 (system ANSI code page 936 / GBK)
Problem
When es.exe writes to a pipe instead of a real console (for example under Git Bash / mintty, or when output is captured by another program), non-ASCII file names come out in the system ANSI code page. On a Chinese system that is GBK, so tools expecting UTF-8 show mojibake:
$ es -n 1 示例 | cat
C:\example\ʾ��
The undocumented -cp 65001 option fixes it:
$ es -cp 65001 -n 1 示例 | cat
C:\example\示例
But it has to be typed on every call. es -cp 65001 -save-settings prints "Settings saved.", yet the code page is not written to es.ini. Looking at src/es.c, _es_cp is initialized from GetConsoleCP() and _es_save_settings_with_filename() does not include it, so there is currently no way to make UTF-8 the default.
Request
Any one of these would solve it:
- Save
-cp/-code-pagewith-save-settingsand read it back from es.ini. - Default to UTF-8 (65001) when stdout is not a console (pipe or file), or offer an option such as
-utf8for that. - At minimum, document
-cpines -hand the README.
Thanks for es, it is very useful for scripting and AI coding agents.
Activity