Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for handling multibyte characters in JSON strings when using src_sqlite() #33

Merged
merged 2 commits into from
Oct 28, 2019
Merged

Fix for handling multibyte characters in JSON strings when using src_sqlite() #33

merged 2 commits into from
Oct 28, 2019

Conversation

rfhb
Copy link
Collaborator

@rfhb rfhb commented Oct 26, 2019

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).

@sckott
Copy link
Contributor

sckott commented Oct 28, 2019

thanks, having a look

@sckott sckott added this to the v0.4 milestone Oct 28, 2019
@sckott
Copy link
Contributor

sckott commented Oct 28, 2019

LGTM

@sckott sckott merged commit 1b5c5af into ropensci:master Oct 28, 2019
@rfhb rfhb deleted the sqlite-fix-multibyte branch October 29, 2019 07:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants