Home | History | Annotate | Download | only in src
      1 import java.nio.charset.Charset;
      2 import java.util.ArrayList;
      3 import java.util.Arrays;
      4 import java.util.Collections;
      5 import java.util.HashSet;
      6 import java.util.List;
      7 import java.util.Map;
      8 import java.util.SortedMap;
      9 import java.util.Set;
     10 
     11 public class Main {
     12     static public void main(String[] args) throws Exception {
     13         // These charsets must be provided; anything else is optional.
     14         List<String> standardCharsets = Arrays.asList("US-ASCII", "ISO-8859-1",
     15                 "UTF-8", "UTF-16BE", "UTF-16LE", "UTF-16");
     16 
     17         SortedMap<String, Charset> all = Charset.availableCharsets();
     18         Set<String> needed = new HashSet<String>(standardCharsets);
     19         for (Map.Entry<String, Charset> e : all.entrySet()) {
     20             String canonicalName = e.getKey();
     21             needed.remove(canonicalName);
     22         }
     23         System.out.println("Missing: " + needed);
     24     }
     25 }
     26