在Java中,可以使用"javax.mail.internet.MimeUtility"类中的"decodeText()"方法来对quoted-printable编码进行解码。以下是一个示例代码:
import javax.mail.internet.MimeUtility;
public class QuotedPrintableDecoder {
public static void main(String[] args) throws Exception {
String encodedText = "Hello=20World=21"; // 替换为需要解码的quoted-printable编码字符串
String decodedText = MimeUtility.decodeText(encodedText);
System.out.println("Decoded Text: " + decodedText);
}
}
运行以上代码,将会输出解码后的文本:“Decoded Text: Hello World!”