Skip to content

Commit

Permalink
Fix Garbled message in non-English Windows
Browse files Browse the repository at this point in the history
Quick fix for the issue atom-community#1166, Java build in non-English editions of Window will result garbled message, stdout and stderr displayed.
This fix would have further issue: if user's final target deployment would have different encodings from all-UTF-8 setup, (such as "normal" Windows cmd.exe, they normally have ANSI encodings for average users) so testing and evaluating might become more difficult.
  • Loading branch information
mhatano authored May 12, 2021
1 parent 443bf81 commit 5a61f1f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/grammars/java.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const Java = {
const classPackages = GrammarUtils.Java.getClassPackage(context)
const sourcePath = GrammarUtils.Java.getProjectPath(context)
if (windows) {
return [`/c javac -Xlint ${context.filename} && java ${className}`]
return [`/c javac ーJ-Dfile.encoding=UTF-8 -Xlint ${context.filename} && java -Dfile.encoding=UTF-8 ${className}`]
} else {
return [
"-c",
Expand Down

0 comments on commit 5a61f1f

Please sign in to comment.