Is this a bug (Windows API)?

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?

+3
source share
1 answer

jamo (ใ…Œใ…ใ…‡) Hangul Compatibility Jamo, - . ( NFKD), jamo Hangul Jamo (แ„ แ…ข แ†ผ, sans , , ), .

Unicode 5.2 :

jamo , NFKD NFKC, jamo .

(...)

12-11 , jamo , NFKD NFKC.

, NFKC , Jamo, Windows, , . , NFKD, , Jamo, NFKC , .

(IME), , Jamo, NFKD, NFKC. IME "" Jamo Jamo.

+2

Source: https://habr.com/ru/post/1752189/


All Articles