-
Notifications
You must be signed in to change notification settings - Fork 83
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
ensure reline's encoding is used when reading inputrc character values #280
Merged
+12
−5
Conversation
This file contains 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
Is it possible to form a test around this behaviour? |
@olleolleolle Sounds possible - I'll add a test |
This change ensures we use `Reline::IOGate`'s `encoding` when converting characters from their integer values. This fixes an issue that may occur if you have UTF characters in your `.inputrc`, but your default encoding isn't set. For example: ``` > 127864.ord.chr RangeError: 127864 out of char range from (pry):1:in `chr' > Reline::IOGate.encoding => #<Encoding:UTF-8> > 127864.ord.chr(Reline::IOGate.encoding) => "🍸" ```
Sweet test, @jethrodaniel! |
aycabta
approved these changes
Apr 20, 2021
aycabta
added a commit
to aycabta/reline
that referenced
this pull request
Apr 20, 2021
ensure reline's encoding is used when reading inputrc character values
aycabta
added a commit
to aycabta/reline
that referenced
this pull request
Apr 20, 2021
In Japan, so many programmers used EUC-JP to write text files which contain Japanese. Many .inputrc files which contain EUC-JP are still being copied and used. This supports whole encoding what user set including UTF-8. ref. ruby#280
aycabta
added a commit
to aycabta/reline
that referenced
this pull request
Apr 20, 2021
In Japan, so many programmers used EUC-JP to write text files which contain Japanese. Many .inputrc files which contain EUC-JP are still being copied and used. This supports whole encoding what user set including UTF-8. ref. ruby#280
aycabta
added a commit
to aycabta/reline
that referenced
this pull request
Apr 20, 2021
In Japan, so many programmers used EUC-JP to write text files that contain Japanese. Many .inputrc files which contain EUC-JP are still being copied and used. This commit supports the whole encoding of what user set including UTF-8. ref. ruby#280
Thank you for the patch, and I added another Pull Request to improve this point! |
matzbot
pushed a commit
to ruby/ruby
that referenced
this pull request
Jun 21, 2021
In Japan, so many programmers used EUC-JP to write text files that contain Japanese. Many .inputrc files which contain EUC-JP are still being copied and used. This commit supports the whole encoding of what user set including UTF-8. ref. ruby/reline#280 ruby/reline@0b45022e16
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.
This change ensures we use
Reline::IOGate
'sencoding
when convertingcharacters from their integer values.
This fixes an issue that may occur if you have UTF characters in your
.inputrc
, but your default encoding isn't set.For example: