how can we send an email with Unicode characters (more specifically, Cyrillic) in the Subject line, using java.awt.Desktop
Here is the small piece of code:
Desktop desktop = Desktop.getDesktop();
String sURI = "firstname.lastname@example.org?SUBJECT=\u041f\u043e\u0437\u0434\u0440\u0430\u0432";
URI uri = new URI("mailto", sURI, null);
MS Outlook will pop open but will show question marks in the subject line (???????).
When I tried to encode the Unicode string with URLEncoder (or with my own base64 encoder), the subject line shows that string just as it is (encoded).
String sURI = "email@example.com?SUBJECT=" + URLEncoder.encode("\u041f\u043e\u0437\u0434\u0440\u0430\u0432", "utf-8");
Can anything be done here? The similar question is applicable also for body of the email.