diff options
Diffstat (limited to 'lib/unicode_normalize/normalize.rb')
-rw-r--r-- | lib/unicode_normalize/normalize.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/unicode_normalize/normalize.rb b/lib/unicode_normalize/normalize.rb index fa18407a6c..8bc8c6f607 100644 --- a/lib/unicode_normalize/normalize.rb +++ b/lib/unicode_normalize/normalize.rb @@ -43,11 +43,11 @@ module UnicodeNormalize ## Hangul Algorithm def self.hangul_decomp_one(target) - index = target.ord - SBASE - return target if index < 0 || index >= SCOUNT - l = LBASE + index / NCOUNT - v = VBASE + (index % NCOUNT) / TCOUNT - t = TBASE + index % TCOUNT + sIndex = target.ord - SBASE + return target if sIndex < 0 || sIndex >= SCOUNT + l = LBASE + sIndex / NCOUNT + v = VBASE + (sIndex % NCOUNT) / TCOUNT + t = TBASE + sIndex % TCOUNT (t==TBASE ? [l, v] : [l, v, t]).pack('U*') + target[1..-1] end |