ObjFW  Diff

Differences From 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]

To Artifact [5aa96c816e]:


30
31
32
33
34
35
36
















37
38
39
40
41
42
43
OF_SUBCLASSING_RESTRICTED
#endif
@interface OFStdIOStream: OFStream
{
	int  _fd;
	bool _atEndOfStream;
}
















@end

#ifdef __cplusplus
extern "C" {
#endif
/*! @file */








>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







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
OF_SUBCLASSING_RESTRICTED
#endif
@interface OFStdIOStream: OFStream
{
	int  _fd;
	bool _atEndOfStream;
}

/*!
 * @brief Query the underlying terminal for the number of columns.
 *
 * @return The number of columns, or -1 if there is no underlying terminal or
 *	   the number of columns could not be queried
 */
- (int)columns;

/*!
 * @brief Query the underlying terminal for the number of rows.
 *
 * @return The number of rows, or -1 if there is no underlying terminal or the
 *	   number of rows could not be queried
 */
- (int)rows;
@end

#ifdef __cplusplus
extern "C" {
#endif
/*! @file */