RTWARNING: Parameters: Character decoding failed. Parameter 'str_content' with value '%u638C%u7BA1' has been ignored. Note that the name and value quoted here may corrupted due to the failed decoding. Use debug level logging to see the original, non-corrupted values.我想获取警告中的 '%u638C%u7BA1' 这个字符串,请问该怎么做呢 ?

解决方案 »

  1.   

    LZ 给你看看其它捕捉例子吧import javax.swing.JOptionPane; public class InputCount { public static void main(String[] args) { 
    String whole=JOptionPane.showInputDialog("请输入一个整数!"); 
    int n=0; 
    try{ 
    n=Integer.parseInt(whole); 
    if(n<1) 
    throw new NumberFormatException(); 
    }catch(NumberFormatException e){ 
    JOptionPane.showMessageDialog(null, "您输入的不是一个正整数!"); 

    if(n==2){ 
    System.out.println("1+2="+(1+2)); 

    if(n==3){ 
    System.out.println("1+2+3="+(1+2+3)); 
    }else if(n>3){ 
    int sum=0; 
    for(int i=1;i<=n;i++){ 
    sum+=i; 

    System.out.println("1+2+3+...+"+n+"="+sum); 

    } } 
    希望对你有帮助
      

  2.   

    谢谢你 不过try{}cathc{}这种方法我试过了。。不行的。可以捕捉异常但是捕捉不到警告
      

  3.   

    警告级别的信息,没法在程序里面捕捉吧。因为不影响程序运行。
    警告这种东西也不是绝对的,比如1.4下面不是警告,1.6下面警告了。这种怎么判断啊。
    哥们,别在这上面浪费时间了,如果你们老大非得有这样要求,那去肯JDK API吧看看里面有你要的吗
      

  4.   

    哦。。JDK的源码 ?我去看看呵呵
      

  5.   

    我现在做了一个发送邮件功能,发送邮件内容有中文,本来在URL那里转下码,然后接收的时候在转一下就行了,现在由于某种原因,我不能在URL那里转码,所以服务器上就获取不到。
      

  6.   

    不知道警告能不能被捕捉,不过你说你是发邮件的内容出现了乱码,我做过邮件。不知道你是怎么传内容的。我是以html格式写的内容。并没有乱码。
    如:
    content.append("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">");
    content.append("<html xmlns=\"http://www.w3.org/1999/xhtml\">");
    content.append("<head><meta http-equiv=\"Content-Type\" ");
    content.append("content=\"text/html; charset=gb2312\" />");
    content.append("<title>标题</title></head><body>");
    content.append("内容</body>");
                    content.append("</html>");