I'm not positive and I don't have a lot of time to reserch this now, but it's possible that upgrading to Term::ReadLine::Gnu-1.32 or newer (released in mid-2016), and then using its new enableUTF8 support might work, or at least get you underway to a real solution.
I spent a few minutes this morning testing this and it appears to me that utf8 is properly supported by kpcli v3.1 (the only one that I tested). In fact, the results were surprising to me and may explain why no one has complained in the past.
I started by testing kpcli-3.1 with Term::Readline::Gnu v1.35 (on Ubuntu 17.10). Here is an example of that test; note the UTF bullet character ("\u2022") in the Uname field:
hightowe:~/bin/kpcli.d$ ./kpcli-3.1.pl --kdb=./test-utf8.kdb
Please provide the master password: *******
KeePass CLI (kpcli-3.1) v3.1 is ready for operation.
Type 'help' for a description of available commands.
Type 'help ' for details on individual commands.
kpcli-3.1:/> show Internet/foo
Path: /Internet/
Title: foo
Uname: • test
Pass:
URL:
Notes:
kpcli-3.1:/> vers
VERSIONS
kpcli: 3.1
Perl: v5.26.0
File::KeePass: 2.03
Term::ShellUI: 0.92
Term::ReadKey: 2.37
Term::ReadLine: 1.16
Capture::Tiny: 0.46
Clipboard: 0.13
Math::Random::ISAAC: 1.003
Sub::Install: 0.928
Term::ReadLine::Gnu: 1.35
ReadLine being used: Term::ReadLine::Gnu
Operating system: linux ("Ubuntu 17.10")
kpcli-3.1:/>
What surprised me is that when I tested this file with kpcli-3.1 on Mint 17 (based on Ubuntu 14.04) it also worked, for both read and write. I had tested that exact setup before I replied to you last week, and it did not work. The only difference in my test last week and today is that last week I was using Putty from Windows and today I was using XTerm on Linux. I now suspect that the terminals, and not the Term::ReadLine::Gnu version, is the difference in utf8 support working or not.
This is my terminal setup that works on Mint 17:
hightowe:~/bin/kpcli.d$ set|grep TERM
TERM=xterm
XTERM_LOCALE=en_US.UTF-8
XTERM_SHELL=/bin/bash
XTERM_VERSION='XTerm(297)'
and the module versions being used by kpcli in my Mint 17 installation:
kpcli-3.1:/> vers
VERSIONS
kpcli: 3.1
Perl: v5.18.2
File::KeePass: 2.03
Term::ShellUI: 0.92
Term::ReadKey: 2.31
Term::ReadLine: 1.12
Capture::Tiny: 0.24
Clipboard: 0.13
Math::Random::ISAAC: 1.003
Sub::Install: 0.927
Term::ReadLine::Gnu: 1.20
ReadLine being used: Term::ReadLine::Gnu
Operating system: linux ("Linux Mint 17 Qiana")
kpcli-3.1:/>
With this finding, I intend to close this bug as not valid / won't fix, but this bug report might prove useful to others. Good luck getting your environment setup to properly support utf8.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm not positive and I don't have a lot of time to reserch this now, but it's possible that upgrading to Term::ReadLine::Gnu-1.32 or newer (released in mid-2016), and then using its new enableUTF8 support might work, or at least get you underway to a real solution.
https://rt.cpan.org/Public/Bug/Display.html?id=104239
You may also be able to stop using Term::ReadLine::Gnu (not my personal preference) and apply some of the things discussed here: https://stackoverflow.com/questions/31573117/using-termreadline-with-unicode-input
In kpcli verion 3.1, the code that you'd want to modify is in the get_readline_term() function that starts on line 4,962.
If you find a workable solution I would appreciate it if you shared it back.
Thanks.
I'm not aware of perl and cpan. Looking at it today didn't bring me far.
It will take some time for me to get into the basics.
I spent a few minutes this morning testing this and it appears to me that utf8 is properly supported by kpcli v3.1 (the only one that I tested). In fact, the results were surprising to me and may explain why no one has complained in the past.
I started by testing kpcli-3.1 with Term::Readline::Gnu v1.35 (on Ubuntu 17.10). Here is an example of that test; note the UTF bullet character ("\u2022") in the Uname field:
hightowe:~/bin/kpcli.d$ ./kpcli-3.1.pl --kdb=./test-utf8.kdb
Please provide the master password: *******
KeePass CLI (kpcli-3.1) v3.1 is ready for operation. ' for details on individual commands.
Type 'help' for a description of available commands.
Type 'help
kpcli-3.1:/> show Internet/foo
Path: /Internet/
Title: foo
Uname: • test
Pass:
URL:
Notes:
kpcli-3.1:/> vers
VERSIONS
ReadLine being used: Term::ReadLine::Gnu
Operating system: linux ("Ubuntu 17.10")
kpcli-3.1:/>
What surprised me is that when I tested this file with kpcli-3.1 on Mint 17 (based on Ubuntu 14.04) it also worked, for both read and write. I had tested that exact setup before I replied to you last week, and it did not work. The only difference in my test last week and today is that last week I was using Putty from Windows and today I was using XTerm on Linux. I now suspect that the terminals, and not the Term::ReadLine::Gnu version, is the difference in utf8 support working or not.
This is my terminal setup that works on Mint 17:
hightowe:~/bin/kpcli.d$ set|grep TERM
TERM=xterm
XTERM_LOCALE=en_US.UTF-8
XTERM_SHELL=/bin/bash
XTERM_VERSION='XTerm(297)'
and the module versions being used by kpcli in my Mint 17 installation:
kpcli-3.1:/> vers
VERSIONS
ReadLine being used: Term::ReadLine::Gnu
Operating system: linux ("Linux Mint 17 Qiana")
kpcli-3.1:/>
With this finding, I intend to close this bug as not valid / won't fix, but this bug report might prove useful to others. Good luck getting your environment setup to properly support utf8.
Back at my office today, and on the same Putty environment that I was on last week when I saw kpcli not support UTF-8, and I figured out why and how to fix it. It is very simple and is described in this article: http://thegreyblog.blogspot.com/2009/08/configuring-putty-to-use-utf-8.html
In short:
As soon as I did that, UTF-8 support in kpcli-3.1 seemed to work as it should.
Last edit: Lester Hightower 2017-12-04