Skip to content

Unexpected Behavior: Empty dataframe when reading from project with special characters #354

Closed
@lrasmus

Description

We have loaded data that contains non-ASCII characters. When calling read, the data frame is coming back empty:

project <- redcap_project$new(redcap_uri = uri, token = token)

#'title' and some other fields cannot be read due to encoding issues, read only abstract and full text review information
df  <- project$read(fields = c(....))

I have traced this back that the httr::POST is correctly returning data from the API, but the call to httr::content is using the default UTF-8 encoding.
The conversion fails, and the data is then returned as empty.

In the current read calls, it doesn't appear to allow overriding the encoding. I am happy to propose a fix and submit a PR, but was wondering if we want the user to always explicitly set the encoding, or if the package should try to detect the encoding using something like the uchardet package:

detect_raw_enc(response$content)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

nonasciiaccommodate non-ascii character

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions