** use O_U8TEXT when writing to the Windows console (or anything
** else for which _isatty() returns true) and to use O_BINARY or O_TEXT
** for all other output channels.
+**
+** The SQLITE_USE_W32_FOR_CONSOLE_IO macro is also available. If
+** defined, it forces the use of Win32 APIs for all console I/O, both
+** input and output. This is necessary for some non-Microsoft run-times
+** that implement stdio differently from Microsoft/Visual-Studio.
*/
#if defined(SQLITE_U8TEXT_ONLY)
# define UseWtextForOutput(fd) 1
*/
wchar_t *b1 = sqlite3_malloc( sz*sizeof(wchar_t) );
if( b1==0 ) return 0;
-#ifndef SQLITE_USE_STDIO_FOR_CONSOLE
+#ifdef SQLITE_USE_W32_FOR_CONSOLE_IO
DWORD nRead = 0;
if( IsConsole(in)
&& ReadConsoleW(GetStdHandle(STD_INPUT_HANDLE), b1, sz-1, &nRead, 0)
sz = MultiByteToWideChar(CP_UTF8, 0, z, sz, b1, sz);
b1[sz] = 0;
-#ifndef SQLITE_STDIO_FOR_CONSOLE
+#ifdef SQLITE_USE_W32_FOR_CONSOLE_IO
DWORD nWr = 0;
if( IsConsole(out)
&& WriteConsoleW(GetStdHandle(STD_OUTPUT_HANDLE),b1,sz,&nWr,0)
}else
#endif
{
- /* For non-console I/O, or if SQLITE_USE_STDIO_FOR_CONSOLE is defined
- ** then write using the standard library. */
+ /* As long as SQLITE_USE_W32_FOR_CONSOLE_IO is not defined, or for
+ ** non-console I/O even if that macro is defined, write using the
+ ** standard library. */
_setmode(_fileno(out), _O_U8TEXT);
if( UseBinaryWText(out) ){
piecemealOutput(b1, sz, out);
-C Have\sfts5\sbetter\shandle\sOOM\serrors\sfrom\ssqlite3_blob_close().
-D 2025-01-23T11:42:21.210
+C The\snew\sSQLITE_USE_W32_FOR_CONSOLE_IO\smacro\scauses\sWin32\sAPIs\nto\sbe\sused\sfor\sconsole\sI/O\sand\sfor\sstdio\sto\sbe\sused\sotherwise.\s\sThis\sis\nreported\sto\sbe\snecessary\sfor\sbuilds\sthat\suse\sa\sC-language\sruntime\sother\sthan\nthe\sone\sprovided\sby\sMicrosoft.\s\sThis\schanges\sif\sfor\sWindows\sonly.\s\sIt\sis\sa\nbug\sfix,\sthough\swe\sdon't\shave\sa\stest\scase\sthat\swill\sdemonstrate\sa\smalfunction.
+D 2025-01-28T01:37:49.966
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d
F ext/misc/showauth.c 732578f0fe4ce42d577e1c86dc89dd14a006ab52
F ext/misc/spellfix.c bcc42ef3fd29429bc01a83e751332b8d4690e65d45008449bdffe7656371487f
F ext/misc/sqlar.c a6175790482328171da47095f87608b48a476d4fac78d8a9ff18b03a2454f634
-F ext/misc/sqlite3_stdio.c 18160504b9348d0ebb9f5620fd61e64cd2d55fffde05ab3f7db03396add4840a
+F ext/misc/sqlite3_stdio.c 0fe5a45bd332b30aef2b68c64edbe69e31e9c42365b0fa79ce95a034bca6fbb0
F ext/misc/sqlite3_stdio.h f05eaf5e0258f0573910324a789a9586fc360a57678c57a6d63cfaa2245b6176
F ext/misc/stmt.c b090086cd6bd6281c21271d38d576eeffe662f0e6b67536352ce32bbaa438321
F ext/misc/stmtrand.c 59cffa5d8e158943ff1ce078956d8e208e8c04e67307e8f249dece2436dcb7fc
F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7
F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P 92b06a4c91ee8f2efa4450bd6f01588139248048f32a6a7918dd10cd6a8e7837
-Q +f418350f3f83147bc5817a885be6e39ff9ff5722742a88d17600729c53c65010
-R 4c166982e9081628f13a0964d220e1c5
-U dan
-Z b93ab420abc842718c6eea6e05360b74
+P 7ffa7e0244bb70a24a9248e477738c6e88176f7bd24294f808a666a1fc5ac3e0
+Q +925e97e6f4238f02259a0c95b1fc668ae32a95329242f8eeae236ef207aca112
+R 52b5f6fb516dc1109aa6788467a015f4
+U drh
+Z 314c784d298017f58045c2b92b573c87
# Remove this line to create a well-formed Fossil manifest.