LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux Mint (https://www.linuxquestions.org/questions/linux-mint-84/)
-   -   Characters being changed when pasted from Keepass (https://www.linuxquestions.org/questions/linux-mint-84/characters-being-changed-when-pasted-from-keepass-4175597082/)

paxolin 01-09-2017 06:40 AM

Characters being changed when pasted from Keepass
 
I have installed Keepass2, (Ubuntu v2.34) as I use this under Windows. Unfortunately it’s not working correctly for me in Mint.

It has the same layout as the Windows version, and I’m using the same database, but when trying to paste a login into a site - either by dragging & dropping it, (as I can do in the Windows version every time) or copying & pasting – all the logins are in English, but in Mint, 20-25% of the time they get transposed into Chinese characters in the login field (sometimes the password too, I know that if the login's correct, but it's rejected).

I've noticed now that a couple of times it has pasted the login ID correctly when I use the drag and drop method, other times it's still pasted as Chinese again.

A few times I’ve tried some logins twice (drag & drop/c&p), without changing the screen, or anything - first time was Chinese, then second time, sometimes third time it’s English.

I have Mint Cinnamon 18.1, using Firedox 50.1.0 My locale, language, region is set to EN-GB, although I’m in Thailand (but definitely not China!)
It was suggested checking Firefox - the Text Encoding to ensure sure Auto-Detect was off, which it was anyway.

Example of websites causing this issue for me: mail.google.com 1and1.com facebook.com reddit.com to name just a few, although I somehow doubt it’s anything to do with the site – they all work fine in KeePass2 under Windows.
outlook.com – this is much more difficult to paste anything into for some reason – this is the only site I’ve had problems with KeePass2 in Windows too Maybe it’s just MS website setup?

It was suggested to me to start a new thread about this specifically. If you want to read the original post, it’s here: http://www.linuxquestions.org/questi...nt-4175596687/

pan64 01-09-2017 07:55 AM

probably LC_LOCALE is not set properly.
I don't know what is ubuntu v2.34

paxolin 01-09-2017 08:49 AM

Quote:

Originally Posted by pan64 (Post 5652394)
probably LC_LOCALE is not set properly.
I don't know what is ubuntu v2.34

I'm sorry, I didn't write that clearly: What I installed is KeePass v2.34 for Ubuntu.

I'm wondering if the LC_LOCALE ia the one I've had help with editing to set my locale to appear as UK?
I typed #locale# in terminal to get this, if that's the one?
I know how to paste that now. It's pasted below, if that's any help.
#LANG=en_GB.UTF-8
LANGUAGE=
LC_CTYPE="en_GB.UTF-8"
LC_NUMERIC=en_GB.UTF-8
LC_TIME=en_GB.UTF-8
LC_COLLATE="en_GB.UTF-8"
LC_MONETARY=en_GB.UTF-8
LC_MESSAGES="en_GB.UTF-8"
LC_PAPER=en_GB.UTF-8
LC_NAME=en_GB.UTF-8
LC_ADDRESS=en_GB.UTF-8
LC_TELEPHONE=en_GB.UTF-8
LC_MEASUREMENT=en_GB.UTF-8
LC_IDENTIFICATION=en_GB.UTF-8
LC_ALL=
#

beachboy2 01-09-2017 11:33 AM

paxolin,

The second answer on here has plenty of detail:
http://unix.stackexchange.com/questi...es-lc-all-c-do

paxolin 01-09-2017 06:52 PM

Quote:

Originally Posted by beachboy2 (Post 5652456)
paxolin,

The second answer on here has plenty of detail:
http://unix.stackexchange.com/questi...es-lc-all-c-do

Thanks so much for your reply.
When I had the editing of the locale settings explained to me step-by-step last week, I had no idea what I was doing, only following the instructions.

I clicked on the link, and I'm sorry to say that my eyes just glazed over as I tried to read the text. I really have very little understanding of any this.
What does it mean in plain English - will it resolve my problem, and if so, what is it I need to do?

pan64 01-10-2017 12:02 AM

if you think your problem is solved please mark the thread solved.
Also if you want to say thanks just click on yes.

paxolin 01-10-2017 12:19 AM

Quote:

Originally Posted by pan64 (Post 5652747)
if you think your problem is solved please mark the thread solved.
Also if you want to say thanks just click on yes.

Err, no the problem isn't solved for me. That was why I wrote that I didn't understand what any of it meant.

pan64 01-10-2017 12:29 AM

Sorry, looks like I misunderstood.
So you need to set LC_* variables properly, otherwise you will get the result what you described (or something similar). Probably it was changed somehow or it was not specified at all.
From the other hand on gui there is a system settings dialog, where you can select language support and also regions and language. Probably you can check them too.
(LC_LOCALE itself does not exist, I wanted to write LC_* variables, the locale, just mixed a bit)

paxolin 01-10-2017 12:44 AM

1 Attachment(s)
Quote:

Originally Posted by pan64 (Post 5652753)
Sorry, looks like I misunderstood.
So you need to set LC_* variables properly, otherwise you will get the result what you described (or something similar). Probably it was changed somehow or it was not specified at all.
From the other hand on gui there is a system settings dialog, where you can select language support and also regions and language. Probably you can check them too.
(LC_LOCALE itself does not exist, I wanted to write LC_* variables, the locale, just mixed a bit)

Ah, now I think I understand that! Is the attached what you're referring to, I wonder?
If so, you can see (from what I can work out) that it's all set to English UK already. Or have I got that wrong?

pan64 01-10-2017 12:57 AM

From here I don't really know, but I can see 22 languages are installed, probably you need to remove the unwanted ones. Probably the system has some built-in "intelligence" and tried to recognise the language you use auto-magically, just cannot identify properly.

paxolin 01-10-2017 01:37 AM

1 Attachment(s)
Quote:

Originally Posted by pan64 (Post 5652763)
From here I don't really know, but I can see 22 languages are installed, probably you need to remove the unwanted ones. Probably the system has some built-in "intelligence" and tried to recognise the language you use auto-magically, just cannot identify properly.

Thanks for the suggestion, I appreciate it.
I've been through and removed all surplus languages (although I didn't see any character-based ones there).
I have left only: EN-US, EN-GB, Thai, Laos. The last two are alphabet-based anyway.

I rebooted and sadly, the first login I tried with drag & drop placed Chinese in the login field again. After I deleted the Chinese from the google login field (but deleting that only, changing nothing else at all), I tried again - this time it was in English.
Obviously when I get to the password field I'll never know if it's correct or not until the login attempt fails.

I suppose looking on the positive side, we've now removed the additional language settings as causing the problem. I still haven't got any further with the #locale# suggestion, but that's only because I have no idea what to do there.

I've attached a screenshot for you to see the problemn.

pan64 01-10-2017 01:56 AM

I do not know where did you set locale (LC_* variables), probably too late.
Also you may need to restart gui (or reboot) to forget those language completely.

paxolin 01-10-2017 02:11 AM

Quote:

Originally Posted by pan64 (Post 5652782)
I do not know where did you set locale (LC_* variables), probably too late.
Also you may need to restart gui (or reboot) to forget those language completely.

If you look, I did say I rebooted Mint already.
Below I have pasted the exact info I followed to change #locale# - that was regarding the date format though:


It came from my query here: http://www.linuxquestions.org/questi...820/page2.html

[to edit the en_GB file to change that date format: the separator from “/” to “-”]

Great. Now for some editing. The default text editor in Mint 18 is xed so we will use that. Again, because it is a system file we need to edit the file as if we were a root user, not an ordinary user. Because we are going to use a GUI program, namely xed, rather than a command on the command line, we use gksudo not sudo (there are some subtle differences between gksudo and sudo which you will find explained elsewhere on the web).

gksudo xed en_GB

You will notice a red bar at the top of the editor that says "Elevated Privileges". This is there to remind you that you are editing as root, not as an ordinary user.

Don't worry that the contents of the file look a bit gobbledy-gook. Those <U0073> etc. are just a way of expressing unicode characters (see here for a list of some of them - http://www.utf8-chartable.de/).

Scroll down until you see the LC_TIME section. Then scroll down until you see the subsection called d_fmt. This is the date format, which is currently set to (translating the unicode characters) %d/%m/%y.

The forward slash is represented as <U002F>. You should see two of them on that line. The hyphen is represented as <U002D>. So, you need to change the F to a D on both occasions.

After you have finished, save the file and exit xed.

pan64 01-10-2017 03:18 AM

no, you misunderstood.
That is the generation of locale files, this is not releted to the usage of them (although only generated locales can be used).
You need to set those LC_* variables to be able to use the generated locales. And my question was were these LC_* variables set.
Probably it is too late. I mean that should happen before the login dialog appeared.

paxolin 01-10-2017 03:36 AM

OK, you've completely lost me! I'm afraid I have no understanding of what it is you're saying there. It's way beyond me.
If there is some way to talk me through it, would that be an option at all? Otherwise I've got no idea, sadly.
Thanks for your persistence with me on this though.


All times are GMT -5. The time now is 06:46 AM.