Strange Unicode Behaviour

Started by
1 comment, last by wagner_fsoares 14 years, 2 months ago
Well, I had my text input working great before upgrading: - Windows (Vista -> 7) - SDL (IDK -> 1.2.14) Now these characters: (´, `, ~, ^, ¨) are being treated like english-only characters. I mean, sometime ago when I pressed the ´ key, it just waited for the next keypress, if the next char can't be combined with ´, then it prints both side by side, if it can (an A for example) it should print Á. But now they're just being printed like any other "normal" character, no more "waiting for the next char" thing. So I'm wondering what could possibly be wrong. This is what was working before:

wchar_t wc = keysym.unicode;

char buf[4] = {0};
if (wc < 0x80)
{
	buf[0] = wc;
}
else if (wc < 0x800)
{
	buf[0] = (0xC0 | wc >> 6);
	buf[1] = (0x80 | wc & 0x3F);
}
else
{
	buf[0] = (0xE0 | wc >> 12);
	buf[1] = (0x80 | wc >> 6 & 0x3F);
	buf[2] = (0x80 | wc & 0x3F);
}
text.insert(cursor, buf); 
Thanks!
Advertisement
You need to make sure your keyboard (that is, the OS setting) is set to US International, not US English. Go to control panel, type in "keyboard" in the search bar and select "Change keyboard or other input methods" and then click "Add". Under "English (United States)" select the "United States - International" keyboard.

The feature you're describing is called "dead keys" by the way...
Well, it was already there so I don't think it could be a keyboard issue, specially when it is working anywhere else.
But the problem could be the way I've installed windows.
My old windows vista disc was made for brazilian users (Brazil-Portuguese-ABTN), so everything was just built in (that's what I think)
This win7 version was made for english users, and after a few weeks I got the language pack that I found on win update.

Could this be the problem?
I just thought about it a few hours ago, so I didn't have time to test it myself.
I'm gonna try it tomomorrow...
Today, cuz it's 3:30AM right now

One more thing, could this "new" SDL 1.3 work with 1.2 sources?
Going to bed now, later!

This topic is closed to new replies.

Advertisement