Always include a UTF-8 BOM at the beginning of the output CSV when using

the ".excel" command on Windows, as the actual Excel program requires the
BOM in order to work correctly.

FossilOrigin-Name: 04727fc00207325a76a5d5f20549c00232810ac727dedb70bc9e8112e60b3f56
This commit is contained in:
drh 2024-09-25 12:56:44 +00:00
parent 853520ddbf
commit 9e59c06fb1
3 changed files with 11 additions and 7 deletions

View File

@ -1,5 +1,5 @@
C Fix\sstray\sfputs()\scalls\sin\sthe\sCLI.
D 2024-09-25T11:38:00.160
C Always\sinclude\sa\sUTF-8\sBOM\sat\sthe\sbeginning\sof\sthe\soutput\sCSV\swhen\susing\nthe\s".excel"\scommand\son\sWindows,\sas\sthe\sactual\sExcel\sprogram\srequires\sthe\nBOM\sin\sorder\sto\swork\scorrectly.
D 2024-09-25T12:56:44.564
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@ -770,7 +770,7 @@ F src/random.c 606b00941a1d7dd09c381d3279a058d771f406c5213c9932bbd93d5587be4b9c
F src/resolve.c 9750a281f7ba073b4e6da2be1a6c4071f5d841a7746c5fb3f70d6d793b6675ea
F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97
F src/select.c 4b14337a2742f0c0beeba490e9a05507e9b4b12184b9cd12773501d08d48e3fe
F src/shell.c.in d91ad1c7b7c00cfe2d5f0577016fa31411b238b0a8eba232087265c89ed134e2
F src/shell.c.in be499bb6bcd951a7fa9480588a824a03cef863c334f1843a2f4b76bcf31bd616
F src/sqlite.h.in 77f55bd1978a04a14db211732f0a609077cf60ba4ccf9baf39988f508945419c
F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
F src/sqlite3ext.h 3f046c04ea3595d6bfda99b781926b17e672fd6d27da2ba6d8d8fc39981dcb54
@ -2215,8 +2215,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P 869b3c05e852a797b5801a81d30a1f7955c31afad0274327f7af2284b555f23a
R 65de7bdaddb9c81ab30a8bc4f548eed2
P 1ee3fa0f0e87a61b5700abd56547c4acefe999317b0d53d66d890d9e09d8b7d9
R aa31813957ce0d0538591043958b4e17
U drh
Z fec9edb9be260bf1b825cec9b6314a72
Z 487c96328e404c2d5a7c68c4fa573337
# Remove this line to create a well-formed Fossil manifest.

View File

@ -1 +1 @@
1ee3fa0f0e87a61b5700abd56547c4acefe999317b0d53d66d890d9e09d8b7d9
04727fc00207325a76a5d5f20549c00232810ac727dedb70bc9e8112e60b3f56

View File

@ -9941,6 +9941,10 @@ static int do_meta_command(char *zLine, ShellState *p){
p->mode = MODE_Csv;
sqlite3_snprintf(sizeof(p->colSeparator), p->colSeparator, SEP_Comma);
sqlite3_snprintf(sizeof(p->rowSeparator), p->rowSeparator, SEP_CrLf);
#ifdef _WIN32
zBom = zBomUtf8; /* Always include the BOM on Windows, as Excel does
** not work without it. */
#endif
}else{
/* text editor mode */
newTempFile(p, "txt");