Index: src/OFStdIOStream_Win32Console.m ================================================================== --- src/OFStdIOStream_Win32Console.m +++ src/OFStdIOStream_Win32Console.m @@ -111,10 +111,11 @@ UTF16 = [self allocMemoryWithSize: sizeof(of_char16_t) count: length]; @try { DWORD UTF16Len; OFDataArray *rest = nil; + size_t i = 0; if (!ReadConsoleW(_handle, UTF16, length, &UTF16Len, NULL)) @throw [OFReadFailedException exceptionWithObject: self requestedLength: length * 2]; @@ -139,13 +140,14 @@ [rest addItems: UTF8 count: UTF8Len]; } _incompleteUTF16Surrogate = 0; + i++; } - for (size_t i = 0; i < UTF16Len; i++) { + for (; i < UTF16Len; i++) { of_unichar_t c = UTF16[i]; char UTF8[4]; size_t UTF8Len; /* Missing high surrogate */