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

ICU-21140 Make UTF-8 explicit for all file access. #1163

Merged
merged 1 commit into from
Jun 3, 2020

Conversation

hagbard
Copy link
Contributor

@hagbard hagbard commented Jun 2, 2020

I found one more case where UTF-8 had to be specified and I made it explicit in all the remaining file accesses I could find. While I'm glad UTF-8 is default in Files.newBufferedReader(), the fact that Java has for so many years assumed that "no charset" implies "system default" means the people reading the code are potentially going to be confused if it's omitted, so I just added it consistently everywhere.

Checklist

@hagbard hagbard requested review from markusicu and jefgen June 2, 2020 20:46
@@ -274,7 +275,7 @@ private static void checkBuild(boolean condition, String message, Object... args

private static ImmutableList<String> readLinesFromResource(String name) {
try (InputStream in = CleanOutputDirectoryTask.class.getResourceAsStream(name)) {
return ImmutableList.copyOf(CharStreams.readLines(new InputStreamReader(in)));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was the one place that actually needed it, the rest of the changes are "no ops" but I think improve readability.

@jira-pull-request-webhook
Copy link

Hooray! The files in the branch are the same across the force-push. 😃

~ Your Friendly Jira-GitHub PR Checker Bot

@jefgen jefgen requested a review from daniel-ju June 3, 2020 17:17
Copy link
Member

@jefgen jefgen left a comment

Choose a reason for hiding this comment

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

Thank you!

@jefgen jefgen self-assigned this Jun 3, 2020
@jefgen jefgen merged commit a29369b into unicode-org:master Jun 3, 2020
@hagbard hagbard deleted the utf_8 branch June 4, 2020 10:29
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.

3 participants