@@ -24,11 +24,11 @@ * write() suddenly returns the number of characters - instead of bytes - * written and read() just returns 0 as soon as a Unicode character is being * read. * * Therefore, instead of just using the UTF-8 codepage, this captures all reads - * and writes to of_std{in,out,err} on the low level, interprets the buffer as + * and writes to OFStd{In,Out,Err} on the low level, interprets the buffer as * UTF-8 and converts to / from UTF-16 to use ReadConsoleW() / WriteConsoleW(). * Doing so is safe, as the console only supports text anyway and thus it does * not matter if binary gets garbled by the conversion (e.g. because invalid * UTF-8 gets converted to U+FFFD). * @@ -86,17 +86,17 @@ if (self != [OFWin32ConsoleStdIOStream class]) return; if ((fd = _fileno(stdin)) >= 0) - of_stdin = [[OFWin32ConsoleStdIOStream alloc] + OFStdIn = [[OFWin32ConsoleStdIOStream alloc] of_initWithFileDescriptor: fd]; if ((fd = _fileno(stdout)) >= 0) - of_stdout = [[OFWin32ConsoleStdIOStream alloc] + OFStdOut = [[OFWin32ConsoleStdIOStream alloc] of_initWithFileDescriptor: fd]; if ((fd = _fileno(stderr)) >= 0) - of_stderr = [[OFWin32ConsoleStdIOStream alloc] + OFStdErr = [[OFWin32ConsoleStdIOStream alloc] of_initWithFileDescriptor: fd]; } - (instancetype)of_initWithFileDescriptor: (int)fd { @@ -177,11 +177,11 @@ (((_incompleteUTF16Surrogate & 0x3FF) << 10) | (UTF16[0] & 0x3FF)) + 0x10000; char UTF8[4]; size_t UTF8Len; - if ((UTF8Len = of_string_utf8_encode(c, UTF8)) == 0) + if ((UTF8Len = OFUTF8StringEncode(c, UTF8)) == 0) @throw [OFInvalidEncodingException exception]; if (UTF8Len <= length) { memcpy(buffer, UTF8, UTF8Len); j += UTF8Len; @@ -234,11 +234,11 @@ 0x10000; i++; } - if ((UTF8Len = of_string_utf8_encode(c, UTF8)) == 0) + if ((UTF8Len = OFUTF8StringEncode(c, UTF8)) == 0) @throw [OFInvalidEncodingException exception]; if (j + UTF8Len <= length) { memcpy(buffer + j, UTF8, UTF8Len); j += UTF8Len; @@ -275,11 +275,11 @@ OFChar16 UTF16[2]; ssize_t UTF8Len; size_t toCopy; DWORD UTF16Len, bytesWritten; - UTF8Len = -of_string_utf8_decode( + UTF8Len = -OFUTF8StringDecode( _incompleteUTF8Surrogate, _incompleteUTF8SurrogateLen, &c); OFEnsure(UTF8Len > 0); toCopy = UTF8Len - _incompleteUTF8SurrogateLen; @@ -291,11 +291,11 @@ _incompleteUTF8SurrogateLen += toCopy; if (_incompleteUTF8SurrogateLen < (size_t)UTF8Len) return 0; - UTF8Len = of_string_utf8_decode( + UTF8Len = OFUTF8StringDecode( _incompleteUTF8Surrogate, _incompleteUTF8SurrogateLen, &c); if (UTF8Len <= 0 || c > 0x10FFFF) { assert(UTF8Len == 0 || UTF8Len < -4); @@ -363,11 +363,11 @@ while (i < length) { OFUnichar c; ssize_t UTF8Len; - UTF8Len = of_string_utf8_decode(buffer + i, length - i, + UTF8Len = OFUTF8StringDecode(buffer + i, length - i, &c); if (UTF8Len < 0 && UTF8Len >= -4) { OFEnsure(length - i < 4);