1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
|
*/
int fossil_utf8_to_console(const char *zUtf8, int nByte, int toStdErr){
#ifdef _WIN32
int nChar;
wchar_t *zUnicode; /* Unicode version of zUtf8 */
DWORD dummy;
static int once = 1;
static int istty[2];
if( once ){
istty[0] = _isatty(fileno(stdout));
istty[1] = _isatty(fileno(stderr));
once = 0;
}
if( !istty[toStdErr] ){
/* stdout/stderr is not a console. */
return -1;
}
nChar = MultiByteToWideChar(CP_UTF8, 0, zUtf8, nByte, NULL, 0);
|
<
|
|
|
<
<
|
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
|
*/
int fossil_utf8_to_console(const char *zUtf8, int nByte, int toStdErr){
#ifdef _WIN32
int nChar;
wchar_t *zUnicode; /* Unicode version of zUtf8 */
DWORD dummy;
static int istty[2] = { -1, -1 };
if( istty[toStdErr] == -1 ){
istty[toStdErr] = _isatty(toStdErr + 1) != 0;
}
if( !istty[toStdErr] ){
/* stdout/stderr is not a console. */
return -1;
}
nChar = MultiByteToWideChar(CP_UTF8, 0, zUtf8, nByte, NULL, 0);
|