Example usage for org.apache.commons.codec.net QuotedPrintableCodec decode

List of usage examples for org.apache.commons.codec.net QuotedPrintableCodec decode

Introduction

In this page you can find the example usage for org.apache.commons.codec.net QuotedPrintableCodec decode.

Prototype

public String decode(String pString, String charset) throws DecoderException, UnsupportedEncodingException 

Source Link

Document

Decodes a quoted-printable string into its original form using the specified string charset.

Usage

From source file:jp.co.worksap.message.decoder.HeaderDecoder.java

private String decodeTextByQuotedPrintable(String encodedText, String charset)
        throws UnsupportedEncodingException, DecoderException {
    // QuotedPrintableCodec version 1.3 don't implement to replace "_" to
    // " ". the rule is in header.
    String grepped = encodedText.replaceAll("_", " ");
    QuotedPrintableCodec codec = new QuotedPrintableCodec();

    return codec.decode(grepped, charset);
}