Handle UTF-8 in TextBuffer type