In Haskell how do I get the number of bytes in a UTF8 string?

Viewed 626

Say I have the UTF8 string "Hello Snowman ☃!". It has 16 characters and takes up 18 bytes. How can I get haskell to show me the number of bytes this string takes up?

I've tried using Data.ByteArray, Data.Text, ByteString and in each case I have come up short.

1 Answers
Related