import java.awt.*; import java.awt.event.*; import java.io.*; import java.util.*; public class FindEncoding extends Frame implements ItemListener,ActionListener { String[] strsEncAll = { "JIS: JIS", "SJIS: PC and Windows Japanese", "EUCJIS: Japanese EUC", "8859_1: ISO Latin-1", "8859_2: ISO Latin 2", "8859_3: ISO Latin-3", "8859_5: ISO Latin/Cyrillic", "8859_6: ISO Latin/Arabic", "8859_7: ISO Latin/Greek", "8859_8: ISO Latin/Hebrew", "8859_9: ISO Latin-5", "Cp1250: Windows Eastern Europe / Latin-2", "Cp1251: Windows Cyrillic", "Cp1252: Windows Western Europe / Latin-1", "Cp1253: Windows Greek", "Cp1254: Windows Turkish", "Cp1255: Windows Hebrew", "Cp1256: Windows Arabic", "Cp1257: Windows Baltic", "Cp1258: Windows Vietnamese", "Cp437: PC Original", "Cp737: PC Greek", "Cp775: PC Baltic", "Cp850: PC Latin-1", "Cp852: PC Latin-2", "Cp855: PC Cyrillic", "Cp857: PC Turkish", "Cp860: PC Portuguese", "Cp861: PC Icelandic", "Cp862: PC Hebrew", "Cp863: PC Canadian French", "Cp864: PC Arabic", "Cp865: PC Nordic", "Cp866: PC Russian", "Cp869: PC Modern Greek", "Cp874: Windows Thai", "MacArabic: Macintosh Arabic", "MacCentralEurope: Macintosh CentralEurope", "Macintosh: Latin-2", "MacCroatian: Macintosh Croation", "MacCyrillic: Macintosh Cyrillic", "MacDingbat: Macintosh Dingbat", "MacGreek: Macintosh Greek", "MacHebrew: Macintosh Hebrew", "MacIceland: Macintosh Iceland", "MacRoman: Macintosh Roman", "MacRomania: Macintosh Romania", "MacSymbol: Macintosh Symbol", "MacThai: Macintosh Thai", "MacTurkish: Macintosh Turkish", "MacUkraine: Macintosh Ukraine", "UTF8: Standard UTF-8" }; String[] strsEncKey = new String[strsEncAll.length]; String currentEnc; String currentFile; TextArea ta = new TextArea(25,80); TextField tfFile = new TextField(); Button btnNewLoad = new Button("new load"); Button btnReLoad = new Button("reload"); Button btnQuit = new Button("quit"); FindEncoding() { super("FindEncoding"); addWindowListener( new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } }); Choice choice = new Choice(); Panel pChoice = new Panel(); pChoice.setLayout(new BorderLayout()); pChoice.add("North",tfFile); pChoice.add("Center",choice); btnReLoad.setEnabled(false); Panel pControl = new Panel(); pControl.add(btnNewLoad); pControl.add(btnReLoad); pControl.add(btnQuit); Panel pOther = new Panel(); pOther.add(pChoice); pOther.add(pControl); add("North",pOther); add("Center",ta); ta.setEditable(false); tfFile.setEditable(false); for (int i=0; i