?gb2312?b?
b 代表base64编码

解决方案 »

  1.   

    经典代码:
        /**
         * 返回字符集名
         */
        public static String getCharSet(String eword) {
    if (!eword.startsWith("=?")) // not an encoded word
        return null;

    // get charset
    int start = 2; int pos; 
    if ((pos = eword.indexOf('?', start)) == -1)
        return null;
    return javax.mail.internet.MimeUtility.javaCharset(eword.substring(start, pos));
    }
    /**
     * 返回编码形式
     */
    public static String getEncoding(String eword) {
    if (!eword.startsWith("=?")) // not an encoded word
        return null;
    int start = 2; int pos; 
    if ((pos = eword.indexOf('?', start)) == -1)
        return null;
    // get encoding
    start = pos+1;
    if ((pos = eword.indexOf('?', start)) == -1)
        return null;
    return eword.substring(start, pos);
        }