Check utf 8 on string encoding

Currently strings are checked for utf-8 correctness only on message decoding. It still may happen that a byte string containing non-utf-8 codes is inserted into a string wire when  encoding a message. With this patch such non-utf-8 values are rejected by encoder.