fix issue when buffer cuts last unicode