You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had issues uploading a large set to AmCAT via amcat.upload.articles.
Repeatedly got the error message: unable to escape string. String is not utf8
I isolated the bug to the package rjson which has certain difficulties handling correct encoding of utf-8 (e.g. see here: ramnathv/rCharts#446).
You can reproduce the bug rather easily with:
library(rjson)
emoji_string <- "I 💗 AmCAT 💥"
json_emoji <- rjson::toJSON(emoji_string)
But if you use the alternative package jsonlite then the string converts correctly:
emoji_string <- "I 💗 AmCAT 💥"
json_emoji <- jsonlite::toJSON(emoji_string)
I created an alternative function that uses jsonlite as backend.
A second minor problem is that the function amcat.upload.articles requires a headline parameter, but AmCAT requires a title field. I am not sure if this is specific to our implementation of AmCAT (autnes.amcat.nl) or just a naming issue of the fields.
A pull request will follow soon.
The text was updated successfully, but these errors were encountered:
this also raises the question whether emojis are desirable in AmCAT in the first place. I am not sure, if elasticsearch can index these correctly and thus become searchable with a query.
If I get around it, I try to implement a feature that would transform emojis to their alternative text versions (e.g. 👍 becomes :thumbsup:
I had issues uploading a large set to AmCAT via
amcat.upload.articles
.Repeatedly got the error message:
unable to escape string. String is not utf8
I isolated the bug to the package
rjson
which has certain difficulties handling correct encoding of utf-8 (e.g. see here: ramnathv/rCharts#446).You can reproduce the bug rather easily with:
But if you use the alternative package
jsonlite
then the string converts correctly:I created an alternative function that uses
jsonlite
as backend.A second minor problem is that the function
amcat.upload.articles
requires aheadline
parameter, but AmCAT requires atitle
field. I am not sure if this is specific to our implementation of AmCAT (autnes.amcat.nl) or just a naming issue of the fields.A pull request will follow soon.
The text was updated successfully, but these errors were encountered: