Search code examples
erlang

How do I find the characters length of a utf8 encoded binary in Erlang?


How do I find the characters length of a utf8 encoded binary in Erlang?


Solution

  • Use the function string:length, it - among other string representations - accepts a binary with UTF8 encoded string as its argument and returns the number of characters.