ObjFW  Diff

Differences From Artifact [f1e2e1ce28]:

To Artifact [70525b9be4]:

  • File src/OFStdIOStream.h — part of check-in [3e1b6bccbc] at 2016-03-12 20:28:31 on branch trunk — Properly handle UTF-8 in Win32 console

    The previous way was to set the codepage to UTF-8, however, this does
    not work properly on some versions of Windows.

    Instead, this catches reads / writes on of_std* on the lowlevel,
    interprets it as UTF-8, converts it to / from UTF-16 and then uses
    ReadConsoleW() / WriteConsoleW().

    Surrogates being cut in the middle is not properly handled yet, this
    will be implemented in a follow up commit. (user: js, size: 1497) [annotate] [blame] [check-ins using]


22
23
24
25
26
27
28

29

30
31
32
33
34
35
36
 * @class OFStdIOStream OFStdIOStream.h ObjFW/OFStdIOStream.h
 *
 * @brief A class for providing standard input, output and error as OFStream.
 *
 * The global variables @ref of_stdin, @ref of_stdout and @ref of_stderr are
 * instances of this class and need no initialization.
 */

OF_SUBCLASSING_RESTRICTED

@interface OFStdIOStream: OFStream
{
	int  _fd;
	bool _atEndOfStream;
}
@end








>

>







22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
 * @class OFStdIOStream OFStdIOStream.h ObjFW/OFStdIOStream.h
 *
 * @brief A class for providing standard input, output and error as OFStream.
 *
 * The global variables @ref of_stdin, @ref of_stdout and @ref of_stderr are
 * instances of this class and need no initialization.
 */
#ifdef OF_STDIO_STREAM_WIN32_CONSOLE_H
OF_SUBCLASSING_RESTRICTED
#endif
@interface OFStdIOStream: OFStream
{
	int  _fd;
	bool _atEndOfStream;
}
@end