-
Notifications
You must be signed in to change notification settings - Fork 178
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
Specify UTF8 encoding. #141
base: master
Are you sure you want to change the base?
Conversation
Java 1.7 is no longer supported. Java 11 is currently supported in LTS, and Java 17 will be the new LTS in September. It's time to bump the version.
This fixes a problem with UTF-16 chars being read as less number of chars than expected which results in an unclosed expression expecting a closing single quote.
Thanks for your contribution! Can you expand a bit on what is going wrong exactly? Perhaps I can add a unit test case for this as well. |
Not needed. This is a best practice and recommended by static analysis tools. The system defaults to whatever the system default is set to. This constraints it to UTF-8 which is recommended. In the case the system is set to UTF-16, emojis fail. |
It's preparation for when this repo upgrades to Java 11/16. |
Please rebase your branch on top of latest master to trigger a build 🙏 |
|
I've quickly run over this PR. I think the only relevant change is the one line with addittion of StandardCharsets.UTF_8. The rest should be reverted. It's strange that @adamoutler removed tests for strings with diacritics -- that's where UTF-8 is really used. System.out.println is for temporary debugging and should have been removed prior to commit/PR. Other than that, I agree that it is safer to explicitly specify encoding. |
Yes. I guess I included items which should not have been in there. The UTF-8 part was discovered as the root of the other problems. |
This fixes a problem with UTF-16 chars being read as less number of chars than expected which results in an unclosed expression expecting a closing single quote.