Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Title: Save -cp / -code-page with -save-settings (fixes #13)
Fixes #13.
Problem
es -cp 65001 -save-settingsprints "Settings saved." but the code page is never written to es.ini, so UTF-8 output has to be requested on every call. Without it, non-ASCII file names come out as?or mojibake when output is piped (Git Bash, scripts, other programs).Change
_es_cp_setting(same pattern asargv_mode):0= use the console code page (the current default behaviour).-cp <n>sets it;-save-settingswritescode_page=<n>to es.ini;_es_load_settingsapplies it when it's non-zero.-cpon the command line still overrides the saved value, and-export-m3ustill forcesCP_ACP.-cp 0 -save-settingsrestores the default.-cp/-code-pageines -hand the README (option 3 in the issue).Existing es.ini files have no
code_pagekey, so they read as0and behave exactly as before.Testing
Built x64 Release (MSVC 14.51) from
mainand from this branch, then ran both against Everything 1.4 with a file namedzqx示例ফাইল.txt, piping the output and checking for the exact UTF-8 bytes:zqx??????.txtzqx??????.txt(unchanged)-cp 65001on the command line-cp 65001 -save-settings, no-cpzqx??????.txt✘-cp 437on the command line?(command line wins) ✔-cp 0 -save-settingses.ini after saving contains
code_page=65001.