Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Warning: Error in gsub: input string 1 is invalid UTF-8 #206
When recording a test with the shinytest package using recordTest(), everything works fine.
There is a pretty easy solution working under Linux & Mac OS:
I did it by
I got the lines of code that contain non-utf8 and removed them.
I'm getting a similar error when comparing current results to expected ones. I also have non-ASCII characters in my code, but in my view the solution shouldn't be to just remove them. What if I need them for some filters for instance?
I found that if I manually open the JSON files as the correct encoding (ISO-8859-1 in my case) and overwrite them as UTF-8, the comparison works fine. Therefore the problem lies in the fact that the JSON files get saved as something different from UTF-8 but then get opened as UTF-8, which produces invalid characters.