class ActiveSupport::Multibyte::Chars

def grapheme_length

'क्षि'.mb_chars.grapheme_length # => 3
'क्षि'.mb_chars.length # => 4

Returns the number of grapheme clusters in the string.
def grapheme_length
  @wrapped_string.scan(/\X/).length
end