$ perl -CADS -E'say $ARGV[0] =~ /(\X{5})/' देवनागरीदेवनागरी देवनागरी
Length of output string is: 5 graphemes, 8 codepoints, 24 octets (UTF-8).
Length of output string is: 5 graphemes, 8 codepoints, 24 octets (UTF-8).