Unicode: Hangul normalize bug
I was involved to fix a similar bug in Python, I found Ruby also has bug code.
We should fix this line like this:
-if length>2 and 0 <= (trail=string.ord-TBASE) and trail < TCOUNT
+if length>2 and 0 < (trail=string.ord-TBASE) and trail < TCOUNT
There was a change of Unicode Standard's demonstration code.
Before Unicode 4.1.0 (draft), here is: TBase <= code <= TBase+TCount
After Unicode 4.1.0, here is TBase < code < TBase+TCount, which in line with Unicode 10.0
This change happened in 2005.
Please note: The normalize algorithm didn't changed, only the demonstration code changed, see this discussion about this point.
Here is some test code for Python, maybe useful for this fix.