if (args.length != 2) {
System.err.println(
"Usage: java Recoder inputEncoding outputEncoding <inFile >outFile");
return;
}
try {
Charset inputEncoding = Charset.forName(args[0]);
Charset outputEncoding = Charset.forName(args[1]);
convert(inputEncoding, outputEncoding, System.in, System.out);
}
catch (UnsupportedCharsetException ex) {
System.err.println(ex.getCharsetName() + " is not supported by this VM.");
}
catch (IllegalCharsetNameException ex) {
System.err.println(
"Usage: java Recoder inputEncoding outputEncoding <inFile >outFile");
}
catch (IOException ex) {
System.err.println(ex.getMessage());
}