use of com.github.mangstadt.vinnie.codec.DecoderException in project vinnie by mangstadt.
the class VObjectReader method decodeQuotedPrintable.
/**
* Decodes the given property's value from quoted-printable encoding.
* @param property the property
* @param listener the data listener
*/
private void decodeQuotedPrintable(VObjectProperty property, VObjectDataListener listener) {
Charset charset = getCharset(property, listener);
if (charset == null) {
charset = defaultQuotedPrintableCharset;
}
String value = property.getValue();
QuotedPrintableCodec codec = new QuotedPrintableCodec(charset.name());
try {
value = codec.decode(value);
} catch (DecoderException e) {
listener.onWarning(Warning.QUOTED_PRINTABLE_ERROR, property, e, context);
return;
}
property.setValue(value);
}
Aggregations