import java.nio.charset.Charset;
import java.util.Iterator;
import java.util.Map;
public class Main {
public static void main(String[] argv) throws Exception {
Map map = Charset.availableCharsets();
Iterator it = map.keySet().iterator();
while (it.hasNext()) {
// Get charset name
String charsetName = (String) it.next();
// Get charset
Charset charset = Charset.forName(charsetName);
}
}
}