mime: respect charset header (default to utf-8)
This commit is contained in:
@@ -172,7 +172,13 @@ public class InputDataOperation extends BaseOperation<InputDataParcel> {
|
||||
|
||||
log.add(LogType.MSG_DATA_MIME_LENGTH, 3, totalLength);
|
||||
|
||||
OpenPgpMetadata metadata = new OpenPgpMetadata(mFilename, bd.getMimeType(), 0L, totalLength);
|
||||
String charset = bd.getCharset();
|
||||
// the charset defaults to us-ascii, but we want to default to utf-8
|
||||
if ("us-ascii".equals(charset)) {
|
||||
charset = "utf-8";
|
||||
}
|
||||
|
||||
OpenPgpMetadata metadata = new OpenPgpMetadata(mFilename, bd.getMimeType(), 0L, totalLength, charset);
|
||||
|
||||
out.close();
|
||||
outputUris.add(uri);
|
||||
|
||||
@@ -34,9 +34,6 @@ public class DecryptVerifyResult extends InputPendingResult {
|
||||
OpenPgpSignatureResult mSignatureResult;
|
||||
OpenPgpDecryptionResult mDecryptionResult;
|
||||
OpenPgpMetadata mDecryptionMetadata;
|
||||
// This holds the charset which was specified in the ascii armor, if specified
|
||||
// https://tools.ietf.org/html/rfc4880#page56
|
||||
String mCharset;
|
||||
|
||||
CryptoInputParcel mCachedCryptoInputParcel;
|
||||
|
||||
@@ -96,14 +93,6 @@ public class DecryptVerifyResult extends InputPendingResult {
|
||||
mDecryptionMetadata = decryptMetadata;
|
||||
}
|
||||
|
||||
public String getCharset () {
|
||||
return mCharset;
|
||||
}
|
||||
|
||||
public void setCharset(String charset) {
|
||||
mCharset = charset;
|
||||
}
|
||||
|
||||
public void setOutputBytes(byte[] outputBytes) {
|
||||
mOutputBytes = outputBytes;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user