Differences From Artifact [03a4b1227f]:
- File
src/OFStdIOStream.m
— part of check-in
[2a27cf3000]
at
2016-01-03 00:41:26
on branch trunk
— Update copyright
While at it, also update the mail address. (user: js, size: 4092) [annotate] [blame] [check-ins using]
To Artifact [b1b921ad96]:
- File src/OFStdIOStream.m — part of check-in [0a001bfd7b] at 2016-02-28 15:31:18 on branch trunk — OFStdIOStream: Set codepage to UTF-8 on Windows (user: js, size: 4555) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | #import "OFStdIOStream.h" #import "OFDate.h" #import "OFApplication.h" #import "OFOutOfRangeException.h" #import "OFReadFailedException.h" #import "OFWriteFailedException.h" OFStdIOStream *of_stdin = nil; OFStdIOStream *of_stdout = nil; OFStdIOStream *of_stderr = nil; @interface OFStdIOStream () - (instancetype)OF_initWithFileDescriptor: (int)fd; @end void of_log(OFConstantString *format, ...) | > > > > > > > > > > > > > > > > | 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | #import "OFStdIOStream.h" #import "OFDate.h" #import "OFApplication.h" #import "OFOutOfRangeException.h" #import "OFReadFailedException.h" #import "OFWriteFailedException.h" #ifdef OF_WINDOWS # include <windows.h> #endif OFStdIOStream *of_stdin = nil; OFStdIOStream *of_stdout = nil; OFStdIOStream *of_stderr = nil; #ifdef OF_WINDOWS UINT originalConsoleCP; UINT originalConsoleOutputCP; static void restoreCodepage(void) { SetConsoleCP(originalConsoleCP); SetConsoleOutputCP(originalConsoleOutputCP); } #endif @interface OFStdIOStream () - (instancetype)OF_initWithFileDescriptor: (int)fd; @end void of_log(OFConstantString *format, ...) |
︙ | ︙ | |||
67 68 69 70 71 72 73 74 75 76 77 78 79 80 | @implementation OFStdIOStream + (void)load { of_stdin = [[OFStdIOStream alloc] OF_initWithFileDescriptor: 0]; of_stdout = [[OFStdIOStream alloc] OF_initWithFileDescriptor: 1]; of_stderr = [[OFStdIOStream alloc] OF_initWithFileDescriptor: 2]; } - init { OF_INVALID_INIT_METHOD } - (instancetype)OF_initWithFileDescriptor: (int)fd | > > > > > > > > > > > > | 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | @implementation OFStdIOStream + (void)load { of_stdin = [[OFStdIOStream alloc] OF_initWithFileDescriptor: 0]; of_stdout = [[OFStdIOStream alloc] OF_initWithFileDescriptor: 1]; of_stderr = [[OFStdIOStream alloc] OF_initWithFileDescriptor: 2]; } #ifdef OF_WINDOWS + (void)initialize { originalConsoleCP = GetConsoleCP(); originalConsoleOutputCP = GetConsoleOutputCP(); atexit(restoreCodepage); SetConsoleCP(CP_UTF8); SetConsoleOutputCP(CP_UTF8); } #endif - init { OF_INVALID_INIT_METHOD } - (instancetype)OF_initWithFileDescriptor: (int)fd |
︙ | ︙ |