/ Published in: ActionScript 3
This example explains why Twitter has a 140 character limit. It shows that the DataType they are using to write to their database is a tinyblob or tinytext.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
var string:String = "i am testing how many bytes ther are in this particular tweet. I'm hoping it's roughly 255 because I will have answered the secret to life."; function getNumBytesUTF8 (s:String):Number { var byteArray:ByteArray = new ByteArray(); byteArray.writeUTFBytes(s); return byteArray.length; } // Usage: trace(getNumBytesUTF8( string )); // 255
URL: http://www.moock.org/blog/archives/000288.html