I had a question about normalizing strings, and the answer was already given, but the problem is that I canโt correctly normalize Korean characters that require 3 keystrokes.
When you type โใ
ใ
ใทโ (from pressing the โaneโ keys), "๋ฌด ใท" instead of "๋ฌป".
When you enter "ใ
ใ
ใ
" (by pressing the "xod" keys), instead of "ํฑ", "ํ ใ
" appears.
This is Mr. Dean's answer, and while he was working on the example that I gave at first ... he does not work with the one I cited above.
If you use .NET, the following will work:
var s = "ใ
ใ
ใ
";
s = s.Normalize(NormalizationForm.FormKC);
In native Win32, the corresponding call to NormalizeString :
wchar_t *input = "ใ
ใ
ใ
";
wchar_t output[100];
NormalizeString(NormalizationKC, input, -1, output, 100);
NormalizeString is only available on Windows Vista +. You need to install the "Microsoft Internationalized Domain Names (IDN) APIs" if you want to use it on XP (why is this in the IDN download, I donโt understand ...)
Note that none of these methods actually require the use of IMEs - they work regardless of whether you have Korean IME installed or not.
This is the code I use in delphi (with XP):
var buf: array [0..20] of char;
temporary: PWideChar;
const NORMALIZATIONKC=5;
...
temporary:='ใ
ใ
ใ
';
NormalizeString(NORMALIZATIONKC , temporary, -1, buf, 20);
showmessage(buf);
This is mistake? Is there something wrong in my code? Does the code work correctly on your computer? What language? What version of Windows are you using?