Subject: | Group names flagged UTF-8, but are LATIN1 |
Date: | Thu, 22 Feb 2018 09:10:07 +0000 |
To: | "bug-File-KeePass [...] rt.cpan.org" <bug-File-KeePass [...] rt.cpan.org> |
From: | Christian Plattner <Christian.Plattner [...] world-direct.at> |
Using File::KeePass version 2.03.
Perl version: (Debian) perl 5, version 24, subversion 1 (v5.24.1) built
for x86_64-linux-gnu-thread-multi
uname -a: Linux *** 4.9.0-4-amd64 #1 SMP Debian 4.9.65-3+deb9u1
(2017-12-23) x86_64 GNU/Linux
When loading a database with non-ASCII strings they appear to be LATIN1,
but are internally tagged as UTF-8 strings in Perl.
Simple example:
# Locale setting: LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8:
# The passwords file was created wit KeePass2.
my $kdb = File::KeePass->new;
$kdb->load_db("passwords.kdbx", "***");
my @groups = $kdb->find_groups({level => 0});
print $title, "\n"; # Garbled output instead of German umlaut
Encode::_utf8_off($title);
print $title, "\n"; # Now, output is OK.
Another example: try loading the same database using the kpcli command
line tool.