Set literal data format tag to UTF8 when encrypting text

This commit is contained in:
Dominik Schürmann 2014-09-13 21:59:47 +02:00
parent f8677a5f16
commit b67b6b7f87

View File

@ -434,7 +434,13 @@ public class PgpSignEncrypt {
}
PGPLiteralDataGenerator literalGen = new PGPLiteralDataGenerator();
pOut = literalGen.open(bcpgOut, PGPLiteralData.BINARY, mOriginalFilename, new Date(),
char literalDataFormatTag;
if (mCleartextInput) {
literalDataFormatTag = PGPLiteralData.UTF8;
} else {
literalDataFormatTag = PGPLiteralData.BINARY;
}
pOut = literalGen.open(bcpgOut, literalDataFormatTag, mOriginalFilename, new Date(),
new byte[1 << 16]);
long alreadyWritten = 0;