Differences From Artifact [c7b07d3dc1]:
- File
src/OFStdIOStream_Win32Console.m
— part of check-in
[9d70e660ea]
at
2016-03-13 20:04:47
on branch trunk
— OFStdIOStream_Win32Console: Use U+FFFD, not U+FFFE
U+FFFD is for unrepresentable characters, not U+FFFE. (user: js, size: 7841) [annotate] [blame] [check-ins using]
To Artifact [856da3e285]:
- File src/OFStdIOStream_Win32Console.m — part of check-in [976162aa79] at 2016-03-13 20:29:46 on branch trunk — OFStdIOStream_Win32Console: Small read fix (user: js, size: 7853) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
109 110 111 112 113 114 115 116 117 118 119 120 121 122 | size_t j = 0; UTF16 = [self allocMemoryWithSize: sizeof(of_char16_t) count: length]; @try { DWORD UTF16Len; OFDataArray *rest = nil; if (!ReadConsoleW(_handle, UTF16, length, &UTF16Len, NULL)) @throw [OFReadFailedException exceptionWithObject: self requestedLength: length * 2]; if (UTF16Len > 0 && _incompleteUTF16Surrogate != 0) { | > | 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 | size_t j = 0; 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]; if (UTF16Len > 0 && _incompleteUTF16Surrogate != 0) { |
︙ | ︙ | |||
137 138 139 140 141 142 143 144 145 | rest = [OFDataArray dataArray]; [rest addItems: UTF8 count: UTF8Len]; } _incompleteUTF16Surrogate = 0; } | > | | 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 | rest = [OFDataArray dataArray]; [rest addItems: UTF8 count: UTF8Len]; } _incompleteUTF16Surrogate = 0; i++; } for (; i < UTF16Len; i++) { of_unichar_t c = UTF16[i]; char UTF8[4]; size_t UTF8Len; /* Missing high surrogate */ if ((c & 0xFC00) == 0xDC00) @throw [OFInvalidEncodingException exception]; |
︙ | ︙ |