implemented buffer with handling for all utf-8 chars

This commit allows to transmit utf-8 data with more than one byte encoding (e.g. umlaute) in chunks.
The point is to always call length on the buffer and not on buffer.toString(). In the latter case, an umlaut only counts as one. However, the expected length refers to the encoded data and therefore assumes two for umlaut.