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 for unicode issue with ConsoleRunner #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

adamlehenbauer
Copy link

simple fix for multi-byte unicode character issue https://sourceforge.net/tracker/?func=detail&aid=3293355&group_id=64033&atid=506056, feeds bytes to higher-level InputStream instead of chars

this is my attempted fix, I've done basic tests with ConsoleRunner and another application that uses ConsoleReader

@hns
Copy link
Contributor

hns commented Apr 27, 2011

I was hoping this would fix non-ASCII characters on Macs with a german keyboard. It doesn't - I still get umlauts read and echoed as "?". Any idea about the cause/fix for that problem?

@adamlehenbauer
Copy link
Author

This is probably because I just used String#getBytes(), which will use the 'platform default' encoding, which appears to be the 'file.encoding' system property, or UTF-8.

I would throw in a System.out.println(sline) around line 94 to ensure that the string is intact there, and then see if specifying an encoding in String#getBytes() fixes it.

I think jline could try to pass around the encodings it pulls in, but those aren't consistent; UnixTerminal uses 'input.encoding' but ConsoleReader uses 'file.encoding'...

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.

2 participants