Fix UTF-8 character corruption every 32kb of text buffer