Method: Unichars#normalize

Defined in:
lib/unichars.rb

#normalize(form = Unichars.default_normalization_form) ⇒ Object

Returns a Unichars instance with the string in normalize form. See www.unicode.org/reports/tr15/tr15-29.html for more information about normalization.

form can be one of the following: :c, :kc, :d, or :kd.

decomposed = [101, 769].pack('U*')
composed = Unichars.new(decomposed).normalize(:kc)
composed.to_s.unpack('U*') #=> [233]


71
72
73
# File 'lib/unichars.rb', line 71

def normalize(form=Unichars.default_normalization_form)
  self.class.new(Glib.utf8_normalize(@wrapped_string, form))
end