Ejemplo

public static void main( String[] args ) {
MimeBodyPart mbp = new MimeBodyPart();
try {
mbp.setText( args[ 0 ]);
byte[] description = ((String)mbp.getContent()).getBytes();
java.io.FileOutputStream out = new java.io.FileOutputStream("Rule.html", true); //$NON-NLS-1$
out.write(description);
}catch (Exception e){
e.printStackTrace();
System.out.println( e.getMessage() );
}
}
Solución
Utilice
javax.mail.internet.MimeBodyPart.setText (String, String) La serie de Unicode se codificará mediante el conjunto de caracteres especificado.
Fíjese en que el conjunto de caracteres especificado debe soportar todos los caracteres de la serie.
Si el lenguaje de la serie es desconocido, utilice UTF-8.

public static void main(String[] args) {
String text = args[0];
String charset = args[1];
javax.mail.internet.MimeBodyPart mbp = new javax.mail.internet.MimeBodyPart();
try {
mbp.setText(text, charset);
byte[] description = ((String) mbp.getContent()).getBytes("UTF-8"); //$NON-NLS-1$
java.io.FileOutputStream out = new java.io.FileOutputStream(
"Rule181-2.html", true); //$NON-NLS-1$
out.write(description);
} catch (Exception e) {
System.out.println(e.toString());
}
}