From the Twitter API docs ( http://dev.twitter.com/pages/counting_characters ):
the 140 chars tweet limit doesn't really count the characters but rather the bytes of the string.
Perhaps there is already a nice counter function for me to use?
Why not just count the characters? For example from the twitter api
"Café" is either 5 or 6 UTF-8 bytes, but it is only supposed to be counted as 4 characters.
"café".length == 4
String.length <= 140