issue-#30 fixing Kernel.IsAlpha for Hiragana and Katakana

Post Reply
User avatar
Josef Templ
Posts: 2047
Joined: Tue Sep 17, 2013 6:50 am

issue-#30 fixing Kernel.IsAlpha for Hiragana and Katakana

Post by Josef Templ »

User X512 reported a problem with Japanese Hiragana and Katakana character sets in Kernel.IsAlpha.
cf. http://community.blackboxframework.org/ ... it=IsAlpha

The problem is that IsAlpha always returns FALSE for such characters (syllables). This follows from
the behavior of WinApi.IsCharAlphaW, which requires alpha characters to be either uppercase or lowercase
but Japanese characters don't have this property. A bug fix has been proposed by X512.
The fix uses WinApi.GetStringTypeW instead of IsCharAlphaW.
I have tested this solution and it works fine. It is also twice as fast as before,
which convinced me to include it in the center distribution.
I have tested the behavior of the old and the new version of IsAlpha and the only difference is with the
mentioned Japanese characters.

See the diffs at http://redmine.blackboxframework.org/pr ... f231d17ad4

- Josef
Last edited by Josef Templ on Mon Mar 09, 2015 9:43 am, edited 1 time in total.
Ivan Denisov
Posts: 1700
Joined: Tue Sep 17, 2013 12:21 am
Location: Russia

Re: issue-#30 fixing Kernel.IsAlpha for Japanese Hiragana an

Post by Ivan Denisov »

If it is faster and is solving the problem, this should be adopted.
Post Reply