import com.Ostermiller.util.CSVParser;
import java.io.InputStreamReader;
import java.io.FileInputStream;
import javax.swing.JOptionPane;

public class CSVCharsetTest {
    public static void main(String[] args) throws Exception {
        CSVParser shredder = new CSVParser(
            new InputStreamReader(
                new FileInputStream("CSVCharsetTest.gb2312csv"),
                "GB2312"
            )
        );
        String t;
        while ((t = shredder.nextValue()) != null) {
            JOptionPane.showMessageDialog(
                null, 
                t, 
                "Value from line " + shredder.getLastLineNumber(), 
                JOptionPane.INFORMATION_MESSAGE
            );
        }
        System.exit(0);
    }
}
