Posts

Showing posts from April, 2012

Finding Java Character Set/Encoding in Linux

Hi all, I have just come to a situation where we want to know about Character set used by Java on Linux Server. So for that I have done some R&D and then find some good code that help me to find or set Character code for Java. Below is the code. I have commented out the code for updating java Character Set. Steps: 1.) Create a file named as  CharacterEncodingExample.java. 2.) Copy & Paste the code to new created file. 3.) Compile Java source code as : #javac CharacterEncodingExample.java 4.) Then run the compiled program. [mc26157@ph132704]~$ java CharacterEncodingExample defaultCharacterEncoding by property: UTF-8 defaultCharacterEncoding by code: UTF8 defaultCharacterEncoding by charSet: UTF-8 ======================================================================= import java.io.ByteArrayInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.io.Inp...