Click to See Complete Forum and Search --> : Receiced mail ecnoding problem for Enclosed CJK letters( 3200-32FF)


skashyap
May 27th, 2002, 11:05 PM
I am getting problem in receiving some character of Japanese e.g. kabu(\u3231), yuu(\u3232) etc. if mail coming with charset="iso-2022-jp"
Content-Transfer-Encoding: 7bit
I am using the following simple program for receiving the mail, its working fine with all mail client those working in SJIS encoding, but in case of outlook its using the Autodetect, from that I am not getting some special character. In the place of that getting "?". Other part of Japanese mail is coming fine.
Please help me to get the solution of the problem.

Thanks
Sanjay Kashyap

package test1;
import javax.mail.*;
import javax.mail.internet.*;
import java.util.Properties;
import javax.mail.Folder;
import javax.mail.Store;

public class TSPReceivedMail {
private static Store store;
private static Folder folder;

public static void main(String[] args) {
try{

String host = "xxxxxxxx";
String username = "xxxxx";
String password = "xxxxxxx";
//Get properties
Properties props = new Properties();
//get session
Session session = Session.getDefaultInstance(props,null);
//get the store
store = session.getStore("pop3");

store.connect(host,username,password);
//get folder
folder = store.getFolder("INBOX");
folder.open(Folder.READ_ONLY);
System.out.println("Message Display Start--->");
//get directory
Message message[] = folder.getMessages();

for(int i =0, n =message.length; i<n; i++){
System.out.println(i + ": " + message.getFrom()[0]
+ "\t" + message.getSubject());
}
System.out.println("<---Message Display End");
//close connection
folder.close(false);
store.close();
} catch (Exception e){}
}
}