Skip to content

Bad encoding in XML export #3900

@selurvedu

Description

@selurvedu

Expected Behavior

KeePassXC CLI outputs the contents of a database in XML format with correct encoding.

Current Behavior

KeePassXC CLI outputs the contents of a database in XML format with non-Latin symbols being encoded incorrectly.

Possible Solution

Fix it.

Steps to Reproduce

  1. Create an empty database: /tmp/Passwords.kdbx.
  2. Insert an entry with any non-Latin text in any field (title / username / password / notes), e. g. Ελληνική λέξη.
  3. Save and close the database.
  4. Execute keepassxc-cli export -f xml /tmp/Passwords.kdbx > /tmp/Passwords.xml.
  5. Enter the password into an empty prompt and press Enter.
  6. Open the resulting file and see the field contents in incorrect encoding.

Additionally, try to import the database back:

  1. Open the XML file with a text editor and remove the first line saying Enter password to unlock /tmp/Passwords.kdbx: .
  2. Execute keepassxc-cli import /tmp/Passwords.xml /tmp/Passwords-imported.kdbx
  3. Enter a new password and press Enter.
  4. See the following messages:
Stripping invalid XML 1.0 codepoint 95
Stripping invalid XML 1.0 codepoint 95
Stripping invalid XML 1.0 codepoint 95
Successfully imported database.

Debug Info

KeePassXC - Version 2.5.0
Revision: 1ab8a9f

Qt 5.13.2
Debugging mode is disabled.

Operating system: Manjaro Linux
CPU architecture: x86_64
Kernel: linux 4.19.84-1-MANJARO

Enabled extensions:

  • Auto-Type
  • Browser Integration
  • SSH Agent
  • KeeShare (signed and unsigned sharing)
  • YubiKey

Cryptographic libraries:
libgcrypt 1.8.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions