-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Chris White
committed
Mar 12, 2018
1 parent
eb705c4
commit 5253286
Showing
4 changed files
with
35 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// ShowCharset.java: print the java default charset. | ||
// Thanks to Roedy Green, https://groups.google.com/forum/#!msg/comp.lang.java.help/hKbaojrSb6E/DJhmo7bpaXUJ | ||
|
||
import java.nio.charset.Charset; | ||
|
||
class ShowCharset { | ||
public static void main(String[] args) { | ||
String defaultEncoding = System.getProperty( "file.encoding" ); | ||
String canonicalName = Charset.forName( defaultEncoding ).name(); | ||
System.out.println(canonicalName); | ||
} //main | ||
}; | ||
|
||
// vi: set ts=2 sts=2 sw=2 et ai: // | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<html><head><title>Find the default Java charset name</title></head> | ||
<body> | ||
<a href="ShowCharset.java">source</a> • | ||
<a href="ShowCharset.class">compiled</a></body> | ||
<p>Run with <pre>java -cp . ShowCharset</pre></p> | ||
</html> | ||
|