Fixes for utf8 headers

Fixed long (>255) utf8 headers + unit-test
Added validation of invalid utf8 sequences (replacing invalid char with "?") + unit-test