consider:
export GNUPGHOME=$(mktemp -d) gpg --quick-gen-key 'Test Usér <tester@example.org>' echo test > test.txt gpgconf --kill gpg-agent LC_ALL=C DISPLAY= DBUS_SESSION_BUS_ADDRESS= gpg --default-key tester@example.org --sign test.txt
The final step here fails with:
gpg: signing failed: A locale function failed
This is an issue on debian because sbuild apparently sets LC_ALL=C during its final signing stage.