fixed utf-8 support for double buffer and in Windows for partial strings