Photo UIDs on --attribute-fd on Windows and strange LF->CRLF conversions

Patrick Brunschwig patrick at
Wed Aug 3 22:16:07 CEST 2005

Hash: SHA1

Michael Schierl wrote:
> (sorry for the private mail, David. I guess I have to read more mailing
> lists to remember clicking the "reply to all" button...)
> David Shaw schrieb:
>>>The problem here is twofold - first, you can't dump jpegs that way.
>>>You'll end up with garbage because it'll be mixed up with the key
>>>listings themselves.  The second problem is related to the first -
>>>you're dumping to stdout, and stdout on windows does textmode
>>>conversion by default.
> Hmm. For that "I can't do it that way" it works surprisingly well :)
> In all my tests it worked to read in "line-mode" and whenever there was an
> line, switch to "byte-mode" and read that many bytes. Then check for
> CR-LFs, compensate by reading a few more bytes, and go on reading in
> "line-mode". That one worked well except in the case where the jpg ended
> with a LF byte.
> FWIW: I have that idea of "overloading stdout" from enigmail, which does
> it exactly that way (if the output in the debugging console is not "faked").

The console is not "faked" but it doesn't care for CRLF conversion. If
you look into the code of Enigmail, you'll notice that it actually does
CRLF conversion on Windows systems to compensate the GnuPG/Windows
output. But note that this is really a Windows-only issue (and probably
GnuPG compiled with MinGW only?), so if you want to be platform
independent you'll need to know the platform.

- -Patrick

Version: GnuPG v1.4.2 (MingW32)
Comment: Using GnuPG with Thunderbird -


More information about the Gnupg-devel mailing list