Wednesday, June 29, 2011

How to List All Available Unicode to Character Set Converters

package org.best.example;


public static void main(String args[])
    {
     Map map = Charset.availableCharsets();
     Iterator it = map.keySet().iterator();
         while (it.hasNext()) {
         // Get charset name
         String charsetName = (String)it.next();
         System.out.println("Charset Name "+charsetName);
       
         // Get charset
         Charset charset = Charset.forName(charsetName);
         System.out.println("Charset "+charset);
     }
}




No comments: