Why does setLocaleEncoding() set sqTextEncoding

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Why does setLocaleEncoding() set sqTextEncoding

Nicolas Cellier
 
Hi all,
I'm trying to gain deeper understanding of unix keyboard events.
I can understand that the unix side might be governed by appropriate locale environment variable. But why changing sqTextEncoding???
sqTextEncoding is the encoding used at image side for a few things, including copy/paste buffer and keyboard event charCode (event at: 3).
Should the image side really need to follow the locale? Does it?
At least, for charCode that does not sound like the right thing!
I have fr_FR.UTF-8, so I'm getting multi-byte encoding for single byte charCode!
Reply | Threaded
Open this post in threaded view
|

Re: Why does setLocaleEncoding() set sqTextEncoding

Nicolas Cellier
 
Hmm,
If I look into sendSelection() I see a dependency on localeEncoding equality:

A reasonably simple scheme nowadays would be exchanging all data (clipboard, drag and drop, ...) between image and VM thru UTF8 encoding...
Of course, it's not the most optimized encoding for eastern asian languages, so we should better think twice, but this could remove considerable complexity from both VM and image (Multilingual) sides.

In which case, sqTextEncoding should rather be UTF8.
BUT: sqTextEncoding should ABSOLUTELY not be used for encoding platform event keycode (charCode).
As suggested in other thread, we could use platform independent keycodes.
The X11 ones are already duplicated in the VM

Le lun. 23 déc. 2019 à 17:33, Nicolas Cellier <[hidden email]> a écrit :
Hi all,
I'm trying to gain deeper understanding of unix keyboard events.
I can understand that the unix side might be governed by appropriate locale environment variable. But why changing sqTextEncoding???
sqTextEncoding is the encoding used at image side for a few things, including copy/paste buffer and keyboard event charCode (event at: 3).
Should the image side really need to follow the locale? Does it?
At least, for charCode that does not sound like the right thing!
I have fr_FR.UTF-8, so I'm getting multi-byte encoding for single byte charCode!