You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This bug report was migrated from our old Bugzilla tracker.
Reported in version: HG 2.1 Reported for operating system, platform: Linux, x86_64
Comments on the original bug report:
On 2015-08-25 00:24:07 +0000, Dennis Felsing wrote:
I'm on Linux, X server 1.17.2 and trying to enter a smiley (☺) in an SDL2 program.
With a compose key this works fine in xev:
KeyPress event, serial 32, synthetic NO, window 0xe00001,
root 0x4a1, subw 0x0, time 14483802, (479,264), root:(1440,283),
state 0x1, keycode 0 (keysym 0x100263a, U263A), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 3 bytes: (e2 98 ba) "☺"
XFilterEvent returns: False
With SDL2' checkkeys I get a wrong output instead:
INFO: INPUT Text (\xc3\xa2\xc2\x98\xc2\xba): "âº"
After looking at it closely, I noticed that the SDL2 string utf8 encodes each utf8 encoded byte. Instead it should just be utf8 encoded once of course.
Is there any way to fix this or work around it? I haven't noticed this problem in anything other than SDL2 programs. SDL1.2 worked fine.
On 2015-09-29 18:12:34 +0000, Alex Baines wrote:
If you add a call to setlocale(LC_ALL, "") at the start of checkkeys.c (and include locale.h in it) is this problem still present?
For me, checkkeys does not work with my compose key at all unless I add a setlocale call, and once I do that I get properly encoded strings.
On 2015-09-29 18:19:12 +0000, Dennis Felsing wrote:
Yes, that works, thanks a lot! So is it recommended to simply use setlocale(LC_ALL, "") at the start of my program or is this something that can be fixed in SDL?
On 2015-09-29 18:42:05 +0000, Alex Baines wrote:
SDL1.2 used to call setlocale internally before calling XOpenIM, but this was changed for some reason in SDL2.
It could be changed back, but this might have been done to fix some other bug, I'm not sure.
It's probably best to call it yourself for the moment.
This bug report was migrated from our old Bugzilla tracker.
Reported in version: HG 2.1
Reported for operating system, platform: Linux, x86_64
Comments on the original bug report:
On 2015-08-25 00:24:07 +0000, Dennis Felsing wrote:
On 2015-09-29 18:12:34 +0000, Alex Baines wrote:
On 2015-09-29 18:19:12 +0000, Dennis Felsing wrote:
On 2015-09-29 18:42:05 +0000, Alex Baines wrote:
On 2016-10-01 21:10:31 +0000, Sam Lantinga wrote:
The text was updated successfully, but these errors were encountered: