Charset conversion during encryption

David Shaw dshaw at
Sun May 30 00:18:23 CEST 2004

On Thu, May 27, 2004 at 01:32:38PM +0200, Holger Sesterhenn wrote:
> Hi,
> as far as I understand the man pages correctly, --textmode just converts
> <LF> to <CR><LF> before encryption. True?


> Looks like no conversion to UTF-8 is done.

Also true.  UTF-8 test in OpenPGP is historically a little weird.  No
program did it, and then the standard came along and required it.  So
everyone basically ignored the standard on that point.  The upcoming
revision to the standard has a fix for this.

> Otherwise the input data is treated as a stram of binary data?


> I have a text with 11 <LF>, 88 bytes in summary. Using --list-packets
> show 88 bytes of data without --textmode and 99 bytes of data with this
> option.

Yep.  GnuPG is adding a <CR> to each of those <LF>es for --textmode.
Note that when you decrypt the message, it changes the <CR><LF> into
whatever is correct for the local platform.  On Unix that means back
to <LF>.  On Win32, it leaves it as <CR><LF>.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 250 bytes
Desc: not available
Url : /pipermail/attachments/20040529/e912d913/attachment-0001.bin

More information about the Gnupg-users mailing list