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

Terminal input ignores detected encoding #6271

Merged

Conversation

matthiasblaesing
Copy link
Contributor

It was observed that on a german windows installation with JDK 17 the terminal correctly shows german umlauts, but fails on input.

The terminal subsystem has code to detect the charset used in the terminal.

Investigation then leads to StreamTerm, where the InputStream for data coming from the terminal is adapted with the detected charset, while the user input is ran through an OutputStreamWriter without charset set. Therefore the user input is encoded with Cp1250 (default on german windows setups). This leads to garbled input.

The fix applies the same logik, that is already applied to the InputStream, also to the OutputStream.

Before:

Bildschirmfoto vom 2023-07-29 15-18-31

After:

Bildschirmfoto vom 2023-07-29 15-09-43

Copy link
Member

@mbien mbien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might be a good candidate for delivery IMO since it is a self contained fix with low risk of side effects.

It was observed that on a german windows installation with JDK 17 the
terminal correctly shows german umlauts, but fails on input.

The terminal subsystem has code to detect the charset used in the
terminal.

Investigation then leads to StreamTerm, where the InputStream for data
coming from the terminal is adapted with the detected charset, while
the user input is ran through an OutputStreamWriter without charset
set. Therefore the user input is encoded with Cp1250 (default on
german windows setups). This leads to garbled input.

The fix applies the same logik, that is already applied to the
InputStream, also to the OutputStream.
@matthiasblaesing matthiasblaesing force-pushed the inputencoding_terminal branch from 2598ba0 to 4a8a8d4 Compare July 29, 2023 19:36
@matthiasblaesing matthiasblaesing added this to the NB19 milestone Jul 29, 2023
@matthiasblaesing matthiasblaesing changed the base branch from master to delivery July 29, 2023 20:13
@matthiasblaesing
Copy link
Contributor Author

Cherry-picked onto delivery, changes base branch, added NB19 milestone.

@BradWalker, @mbien thank you for review!

@neilcsmith-net neilcsmith-net merged commit 61a38aa into apache:delivery Jul 31, 2023
@matthiasblaesing matthiasblaesing deleted the inputencoding_terminal branch August 12, 2023 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants