Added support for buffer length

utf-8 strings can have 1 and 2 byte characters. Some - if not many - systems have a byte limit, not a length limit thus it might be important to actually set the byte limit. I added three methods that should offer this possibility.