Or simply set the limit in bytes (e.g. 140 bytes of UTF8 encoded text).
This is the standard (for good reason) in code golf.
This is the standard (for good reason) in code golf.