This PR fixes an perhaps rare error of functions docdb_{get,query}() when using an src_sqlite() connection with certain multibyte characters in the JSON data, under Windows. The error reads,
> nodbi::docdb_get(src, key)
Error in FUN(X[[i]], ...) : invalid multibyte string, element 1
To address the issue, the streaming of the JSON string using cat was changed to use a connection object, because the latter permits to specify an encoding (UTF-8, compare help(connections), section Encoding). Into this PR, the removal of the temporary file was added (which I previously overlooked).
This PR fixes an perhaps rare error of functions
docdb_{get,query}()
when using ansrc_sqlite()
connection with certain multibyte characters in the JSON data, under Windows. The error reads,To address the issue, the streaming of the JSON string using
cat
was changed to use a connection object, because the latter permits to specify an encoding (UTF-8, comparehelp(connections)
, section Encoding). Into this PR, the removal of the temporary file was added (which I previously overlooked).