Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix chcp parsing for the current codepage #888

Merged
merged 1 commit into from
Oct 4, 2019

Conversation

janlazo
Copy link
Collaborator

@janlazo janlazo commented Oct 1, 2019

Fix #874
Fix #884
Fix #885
Related #886

cc @gh4w

Patch is adapted from stackoverflow answer, https://stackoverflow.com/a/10535753

Relying on delimiters or token positions is fragile.
Last value of 'chcp' output is always a number.
@janlazo janlazo mentioned this pull request Oct 1, 2019
11 tasks
@janlazo janlazo merged commit 849b76b into junegunn:master Oct 4, 2019
@janlazo janlazo deleted the chcp-last branch October 4, 2019 01:19
@junegunn
Copy link
Owner

junegunn commented Oct 8, 2019

Thanks. Maybe I should port this to fzf?

@janlazo
Copy link
Collaborator Author

janlazo commented Oct 8, 2019

Yes.

junegunn added a commit to junegunn/fzf that referenced this pull request Oct 8, 2019
@janlazo
Copy link
Collaborator Author

janlazo commented Oct 9, 2019

The parsing doesn't take into account codepage values mixed with non-numeric characters. Need sed or some cmd.exe alternative to strip out non-numeric characters after the for-loops. I'll open a PR later for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants