Does exporting a public key on Windows 11 on the command line lead to a broken file (utf-16 LE)?

Hello,
if you happen to have Gpg4win 4.3.1 running on a Windows 11 system (and there are not enough responses yet further down) could you try exporting a public key on the command line
and see if you can import it again? That would help me to reproduce a potential defect.
gpg --armor --export SOMEID > test_export.asc
gpg --import test_export.asc

Chris J. reported getting a utf-16 LE file as result on the mailing list and I may lack a test system were this can be reproduced. [Gpg4win-users-en] --export incompatible with --import

(If you want to import and export my pubkey, you would find it here: https://intevation.de/~bernhard/bernhard_gpgkey.asc. )
If you can reproduce, please show the first few lines of the exported file here.

Thanks! Bernhard

The problem is understood, thanks to Ingo. (See the email thread linked above).

Using something like gpg --armor --export-key XYZ >pubkey_xyz.asc which is a redirection on Powershell whill lead to a text file that gpg cannot import anymore.

The error message looks like

gpg: [don't know]: partial length invalid for packet type 63
gpg: read_block: read error: Invalid packet
gpg: import from 'gpg-export-on-powershell.asc' failed: Invalid keyring
gpg: Anzahl insgesamt bearbeiteter Schlüssel: 0

A solution is use the --output option of gpg. :slight_smile: