diff options
author | drh <> | 2024-10-11 19:57:41 +0000 |
---|---|---|
committer | drh <> | 2024-10-11 19:57:41 +0000 |
commit | 4859bc9a9ffdb9fa555a57db3593ccb08a0be983 (patch) | |
tree | 6a7a267a9622d28e8fab6a00739ca2c7f899de69 /ext/misc/sqlite3_stdio.c | |
parent | 4dfc4dc2dfebea8a6f3a73f82977160833ecf156 (diff) | |
download | sqlite-4859bc9a9ffdb9fa555a57db3593ccb08a0be983.tar.gz sqlite-4859bc9a9ffdb9fa555a57db3593ccb08a0be983.zip |
Update comments in ext/misc/sqlite3_stdio.c to reflect the latest enhancements.
No changes to code.
FossilOrigin-Name: 9621c3b527702b47799538e028f96945b5697752dbb56078aa7f114c72fd4e1a
Diffstat (limited to 'ext/misc/sqlite3_stdio.c')
-rw-r--r-- | ext/misc/sqlite3_stdio.c | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/ext/misc/sqlite3_stdio.c b/ext/misc/sqlite3_stdio.c index 393815522..81fcfe23f 100644 --- a/ext/misc/sqlite3_stdio.c +++ b/ext/misc/sqlite3_stdio.c @@ -31,27 +31,17 @@ #include <fcntl.h> /* -** If the SQLITE_U8TEXT_ONLY option is defined, then only use -** _O_U8TEXT, _O_WTEXT, and similar together with the UTF-16 -** interfaces to the Windows CRT. The use of ANSI-only routines -** like fputs() and ANSI modes like _O_TEXT and _O_BINARY is -** avoided. +** If the SQLITE_U8TEXT_ONLY option is defined, then use O_U8TEXT +** when appropriate on all output. ** -** The downside of using SQLITE_U8TEXT_ONLY is that it becomes -** impossible to output a bare newline character (0x0a) - that is, -** a newline that is not preceded by a carriage return (0x0d). -** And without that capability, sometimes the output will be slightly -** incorrect, as extra 0x0d characters will have been inserted where -** they do not belong. +** If the SQLITE_U8TEXT_STDIO option is defined, then use O_U8TEXT +** when appropriate when writing to stdout or stderr. Use O_BINARY for +** anything else. ** -** The SQLITE_U8TEXT_STDIO compile-time option is a compromise. -** It always enables _O_WTEXT or similar for stdin, stdout, stderr, -** but allows other streams to be _O_TEXT and/or O_BINARY. The -** SQLITE_U8TEXT_STDIO option has the same downside as SQLITE_U8TEXT_ONLY -** in that stray 0x0d characters might appear where they ought not, but -** at least with this option those characters only appear on standard -** I/O streams, and not on new streams that might be created by the -** application using sqlite3_fopen() or sqlite3_popen(). +** The default behavior, if neither of the above is defined is to +** use O_U8TEXT when writing to the Windows console (or anything +** else for which _isatty() returns true) and to use O_BINARY for +** all other output. */ #if defined(SQLITE_U8TEXT_ONLY) # define UseWtextForOutput(fd) 1 |