Skip to content

Commit

Permalink
Added java-charset utility
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris White committed Mar 12, 2018
1 parent eb705c4 commit 5253286
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 8 deletions.
21 changes: 13 additions & 8 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
<body>
<h2>Welcome to cxw42.github.io!</h2>

<p><a href="linky.html">Link-making utility</a></p>
<ul>
<li><a href="linky.html">Link-making utility</a></li>

<p>
<li><a href="java-charset/">A small routine to print the default Java charset</a></li>

<li>
<a href="htdocs/Xanadu-archaeology/articles/text/FrontPage.html">Mirror of
sunless-sea.net, the Xanadu cyberarchaeology project.</a>
</p>
<p><a href="allfiles.html">List of all files in the mirror</a></p>

<ul><li><a href="allfiles.html">List of all files in the mirror</a></li></ul>
<p>
Many thanks to Jeff Rush,
David Durand and Roger Gregory for this amazing resource
Expand All @@ -19,20 +20,24 @@ <h2>Welcome to cxw42.github.io!</h2>
<a href="https://github.com/dotmpe/udanax-mpe/tree/master/var/htdocs">a
mirror</a>!
</p>

<p>
I will be converting this over time - making links active and
the like. Pull requests welcome
<a href="https://github.com/cxw42/cxw42.github.io">here</a>.
</p>
</li>

</ul>

<h2>About me</h2>
<p>
<a href="https://www.linkedin.com/in/chriswhiteinnovation">LinkedIn</a> &bull;
<a href="https://stackexchange.com/users/3433783/cxw">StackExchange</a> &bull;
<a href="http://www.devwrench.com">Blog</a> &bull;
<a href="https://github.com/cxw42">GitHub</a>
<a href="https://github.com/cxw42">GitHub</a> &bull;
<a href="https://bitbucket.org/cxw42/">Bitbucket</a>
</p>

<p>Made with <a href="http://www.vim.org">vim</a></p>
</body>
</html>

Binary file added java-charset/ShowCharset.class
Binary file not shown.
15 changes: 15 additions & 0 deletions java-charset/ShowCharset.java
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: //

7 changes: 7 additions & 0 deletions java-charset/index.html
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> &bull;
<a href="ShowCharset.class">compiled</a></body>
<p>Run with <pre>java -cp . ShowCharset</pre></p>
</html>

0 comments on commit 5253286

Please sign in to comment.