buffer: introduce utf8 encoding
buffer: use writeString for utf8/verbatim
buffer: consolidate writeString
buffer: implement ucs2Write