R Notebook SQL chunk fails with special characters

rmarkdown

#1

I’m having problem using R Notebook code chunk for SQL query with special characters (Ü for example) in where condition. Same time dbGetQuery() function works fine with special characters. Any idea what could be the problem and how to solve it?

Capture


#2

This is most likely an encoding issue. Any chance you can provide a reproducible example?

The simplest way might be to use RSQLite to create a small dummy table where some entries contain accented characters.


#3

Thank you @kevinushey
Yes, it’s an encoding problem. Query works fine when I pass condition as R variable. Also small tests with local SQLite and Postgre databases didn’t produce this issue.
Capture


#4

What kind of SQL connection are you using in the example that’s failing? If the development team is able to reproduce the issue, then we’ll be more likely to be able to fix the problem.