Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

on FreeBSD 13.3 issues with extended chars #49

Open
rmottola opened this issue Sep 12, 2024 · 2 comments
Open

on FreeBSD 13.3 issues with extended chars #49

rmottola opened this issue Sep 12, 2024 · 2 comments
Assignees

Comments

@rmottola
Copy link
Member

Small sum up of email thread.

After FreeBSD 13.3 update, extended character typing (e.g. àè or ° and €) started not working and outputting multiple characters.
It appears to be linked to these env. variables set:
LANG=C.UTF-8
XMODIFIERS="@im=kinput2"

@rmottola
Copy link
Member Author

Even without setting XMODIFIERS (when things appear to "work" for the user) I noticed that KeyPress and KeyRelease characters are different for extended characters:

2024-09-11 23:19:51.042 Ink[2352:100713] XKeyEvent keyCode 22
2024-09-11 23:19:51.042 Ink[2352:100713] unicode modifiers: 0
2024-09-11 23:19:51.042 Ink[2352:100713] unicode no modifiers: 0
2024-09-11 23:19:51.042 Ink[2352:100713] process_key_event: keys:è ukeys:è
2024-09-11 23:19:51.125 Ink[2352:100713] XKeyEvent keyCode 22
2024-09-11 23:19:51.125 Ink[2352:100713] unicode modifiers: 0
2024-09-11 23:19:51.125 Ink[2352:100713] unicode no modifiers: 0
2024-09-11 23:19:51.125 Ink[2352:100713] process_key_event: keys:è ukeys:è 

It is partially expected: On KeyPress the character conversion is done by using Xutf8LookupString and initialising NSString with NSUTF8StringEncoding, while on KeyRelease Xutf8LookupString is not available per X11 spec, then XLookupString is used and string is initialised using NSISOLatin1StringEncoding. One would expect that at least for Latin1 characters it should be equivalent, but not and the string contains "garbage".

@rmottola
Copy link
Member Author

I found out that when the Latin1 is not interpreted correctly, count my XLookupString is > 1, it means it cannot be a single char of a key. It may be 2 long for e.g. à, but 3 for €.

I tried some smartness and if I interpret it as UTF8, all appears to work!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants