Skip to content

Commit

Permalink
Extract charset to a separate variable
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Pinčuk <alexander.v.pinchuk@gmail.com>
  • Loading branch information
avpinchuk committed Feb 27, 2024
1 parent a4845f2 commit d5f0c7b
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,10 @@ private Terminal createTerminal() throws IOException, CommandException {
throw new CommandException("File: " + file + " can not be read");
}

return new ExternalTerminal(REMOTE_COMMAND, "dumb", new FileInputStream(file), new EmptyOutputStream(),
encoding != null ? Charset.forName(encoding) : Charset.defaultCharset());
Charset charset = encoding == null ? Charset.defaultCharset() : Charset.forName(encoding);

return new ExternalTerminal(REMOTE_COMMAND, "dumb",
new FileInputStream(file), new EmptyOutputStream(), charset);
}

System.out.println(STRINGS.get("multimodeIntro"));
Expand Down

0 comments on commit d5f0c7b

Please sign in to comment.