From 589ce93e9efc754334ef1f38c04bef9d0cbac891 Mon Sep 17 00:00:00 2001 From: drh <> Date: Fri, 11 Oct 2024 23:31:37 +0000 Subject: Additional clarification in the comments to sqlite3_stdio.c. No changes to code. FossilOrigin-Name: 2db24c5364808008fa503f37ca8ccf5d135e8f6bfac2efb29e509e26f7190470 --- ext/misc/sqlite3_stdio.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'ext/misc/sqlite3_stdio.c') diff --git a/ext/misc/sqlite3_stdio.c b/ext/misc/sqlite3_stdio.c index 81fcfe23f..6c0f5afca 100644 --- a/ext/misc/sqlite3_stdio.c +++ b/ext/misc/sqlite3_stdio.c @@ -32,16 +32,20 @@ /* ** If the SQLITE_U8TEXT_ONLY option is defined, then use O_U8TEXT -** when appropriate on all output. +** when appropriate on all output. (Sometimes use O_BINARY when +** rendering ASCII text in cases where NL-to-CRLF expansion would +** not be correct.) ** ** 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. +** when appropriate when writing to stdout or stderr. Use O_BINARY +** or O_TEXT (depending on things like the .mode and the .crnl setting +** in the CLI, or other context clues in other applications) for all +** other output channels. ** ** 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. +** else for which _isatty() returns true) and to use O_BINARY or O_TEXT +** for all other output channels. */ #if defined(SQLITE_U8TEXT_ONLY) # define UseWtextForOutput(fd) 1 -- cgit v1.2.3