Saturday, 16 June 2018

How Read UTF-8 Encoded Data java program

what is UTF-8 Encoded Data?
UTF-8. UTF-8 is a variable width character encoding capable of encoding all 1,112,064 valid code points in Unicode using one to four 8-bit bytes. The encoding is defined by the Unicode standard, and was originally designed by Ken Thompson and Rob Pike.Unicode is a character encoding standard that has widespread acceptance. Microsoft software uses Unicode at its core. ... They store letters and other characters by assigning a number for each one. Before Unicode was invented, there were hundreds of different encoding systems for assigning these numbers.

How Reading UTF-8 Encoded Data java program

     public static void main(String args[]){
         try{
         BufferedReader in = new BufferedReader(
         new InputStreamReader(new FileInputStream("file.txt"), "UTF8"));
         String str = in.readLine();
         System.out.println(str);
     }
         catch (Exception ioe){
         ioe.printStackTrace();
     }
}

0 comments:

Post a Comment