Count encoded bytes in Julia

The core endof function returns the number of bytes in UTF-8 when called on a string.

count = endof(str)