views:

41

answers:

1

For example (I'm using Korean IME btw) can I get 태우다 from sending "xodnek" (as a string)?

If that isn't possible, can I get 태우다 from it's individual characters ㅌㅐㅇㅜㄷㅏ (which is from the keys "xodnek").

+1  A: 

If you are using .NET, the following will work:

var s = "ㅌㅐㅇㅜㄷㅏ";
s = s.Normalize(NormalizationForm.FormKC);
// s now contains "태우다"

In native Win32, the corresponding call is NormalizeString:

wchar_t *input = L"ㅌㅐㅇㅜㄷㅏ";
wchar_t output[100];
NormalizeString(NormalizationKC, input, -1, output, 100);

NormalizeString is only available in Windows Vista+. You need the "Microsoft Internationalized Domain Name (IDN) Mitigation APIs" installed if you want to use it on XP (why it's in the IDN download, I don't understand...)

Note that neither of these methods actually requires use of the IME - they work regardless of whether you've got the Korean IME installed or not.

Dean Harding
Dian
@Dian: unfortunately, I don't know enough about Delphi to be able to help you with that. I assume there must be some way to call C APIs in DLLs, but I don't know what it is, sorry!
Dean Harding
Oh, okay. I've never used DLLs before, so that's why I don't know, but there is definitely a way to do that.Thanks again for your answer. It helped heaps.
Dian
I made it work...but I have an issue. I think it's the characters that have 3 keystrokes. When I type "ane" I get "무ㄷ" instead of "묻". Is it just me? Is this a bug?
Dian