class ActiveSupport::Multibyte::Chars

def compose

'é'.mb_chars.compose.to_s.length # => 2
'é'.length # => 3

Performs composition on all the characters.
def compose
  chars(Unicode.compose(@wrapped_string.codepoints.to_a).pack('U*'))
end