module ActiveSupport::Multibyte::Unicode

def pack_graphemes(unpacked)

Unicode.pack_graphemes(Unicode.unpack_graphemes('क्षि')) # => 'क्षि'

Reverse operation of unpack_graphemes.
def pack_graphemes(unpacked)
  unpacked.flatten.pack('U*')
end